How to set, retrieve and unset the session variables in magento
Hello Friends, You can find the code here to set, retrieve and unset Session Variables in magento.
To set a Magento session variable:
To set a Magento session variable:
$myValue = 'Hello World';
Mage::getSingleton('core/session')->setMyValue($myValue);
To Retrieve a magento session variable which is already set:
$myValue=Mage::getSingleton('core/session')->getMyValue();
To Unset:
Mage::getSingleton('core/session')->unsMyValue();
Note: ‘MyValue’ can be any text you want but ‘set’, ‘get’ and ‘uns’ prefixes are required. Thanks,
Kerry
Kerry Page
