Feb 222012
 

To set a Magento session variable:

$myValue = 'Hello World';
Mage::getSingleton('core/session')->setMyValue($myValue);

To Retrieve:

$myValue = '';
$myValue=Mage::getSingleton('core/session')->getMyValue();

To Unset:

Mage::getSingleton('core/session')->unsMyValue();

Note that ‘MyValue’ can be any text you want but ‘set’, ‘get’ and ‘uns’ prefixes are required.