Magento: Get Set Unset Session
Set a custom session with Variable Name ‘testing_magento’. The session value here is ‘hello’.
Mage::getSingleton('core/session')->setTestingMagento('hello');
Get session testing_magento
$test = Mage::getSingleton('core/session')->getTestingMagento();
Unset session
Mage::getSingleton('core/session')->setTestingMagento();
(Use customer or core session in frontend. Use adminhtml session in the backend.)
Core Session:- Mage::getSingleton(‘core/session’)
Customer Session:- Mage::getSingleton(‘customer/session’)
Admin Session:- Mage::getSingleton(‘adminhtml/session’)
Related posts:
- Magento: Send email easily using Zend_Mail
- Magento: How to get admin user id, name, username, email, etc?
- Magento: Block Controller Model Helper Override
- Session Handling in PHP
- Magento: How to run Magento code in an external website?
- Magento: Track Visitor’s Information
- Magento: Create Shopping Cart Price Rule Programmatically
- Magento: How to get most viewed products?
- jQuery: Grey out background and preview image as popup
- Magento: Send Transactional Email
