Suppose you want to set a custom session with Variable Name ‘testing_magento’. The session value here is ‘EWA’ then the syntax will be:
Set Session In Magento:
Mage::getSingleton('core/session')->setTestingMagento('EWA');
Get session testing_magento
$test = Mage::getSingleton('core/session')->getTestingMagento();
Unset Session In Magento
Mage::getSingleton('core/session')->setTestingMagento();
(You can use customer or core session in frontend. Use adminhtml session in the backend.)
Core Session In Magento
Mage::getSingleton('core/session');
Customer Session In Magento:
Mage::getSingleton('customer/session');
Admin Session In Magento:
Mage::getSingleton('adminhtml/session');
Hope this will be helpful, Thanks and Enjoy the Magento Custom Coding.