How to set session and get session in magento

5
22
views
Advertisement

You can create new session using below syntax:

Mage::getSingleton('core/session')->setYourVariable('data');
$Data = Mage::getSingleton('core/session')->getYourVariable();

-Mayank Zalavadia 🙂

5 COMMENTS

  1. Hi Mayank,

    First off, apologies because this is slightly off topic, but I have a Magento problem relating to retrieving data from sessions. I want to retrieve the last advanced search and add it to the "continue shopping" link. Can you offer any advice on how to go about creating that functionality?