Showing posts with label Session. Show all posts
Showing posts with label Session. Show all posts

November 10, 2014

What happen when Browser Cookie will Removed, Session retains as its ?


When webpage was loaded, unique session id will generated and that stored in cookie. If cookie will removed then session cant retain.

PHP Session and Cookie


The main difference between sessions and cookies is that cookies are stored in the user's browsers, and session are stored in server.

A cookie is small file that store in user's computer. Cookie data expiry depend on expiration date where session retain until browser run.

December 19, 2013

Magento Get the customer session Id

Mage::getSingleton('customer/session')->getId()


or

if(Mage::getSingleton('customer/session')->isLoggedIn()) {

     $user = Mage::getSingleton('customer/session')->getCustomer();

     echo $user->getId();

}

Magento Get the admin session user id


Get the user id

Mage::getSingleton('admin/session')->getUser()->getId()


User details

Mage::getSingleton('admin/session')->getUser()