Set session Data
$session = Mage::getSingleton("core/session", array("name"=>"frontend"));
$session->setData("day_filter", 'weeks');
$session->setData("days", '5');
$session->setData("next_delivery_date", '2012-05-12');
or
Mage::getSingleton('core/session')->setIsSalesrepTax('test');
UnSet session Data
$session->unsetData('day_filter');
$session->unsetData('days');
$session->unsetData('next_delivery_date');
$session->unsetData('
IsSalesrepTax
');
Session Data Set to null
$session->setData('day_filter', NULL);
$session->setData('days', NULL);
$session->setData('next_delivery_date', NULL);
Magento Set, Retrieve and Unset Session Variables
To set a Magento session variable:
$myValue = 'My session';
Mage::getSingleton('core/session')->setMyValue($myValue);
To Retrieve:
$myValue=Mage::getSingleton('core/session')->getMyValue();
To Unset:
Mage::getSingleton('core/session')->unsMyValue();
No comments:
Post a Comment