Wednesday, August 14, 2013

Session management in Magento

To set the value of Magento session variable:

$theValue = 'Bhavana';
Mage::getSingleton('core/session')->setMySessionvariable($theValue);

You can retrieve the value of session variable as following:
Mage::getSingleton('core/session')->getMySessionvariable();

To unset the value of session variable:
Mage::getSingleton('core/session')->unsMySessionvariable();

No comments:

Post a Comment

Fatal error: Class Zend\Stdlib\Parameters contains 1 abstract method... magento 2

Fatal error: Class Zend\Stdlib\Parameters contains 1 abstract method and must therefore be declared abstract or implement the remaining met...