Tag Archives: session

how to set get and unset custom session variable value in Magento.

In magento we can set session ,get session and unset session custom session variable value in magento.


<?php

// For Set custom session in Magento 
$setSessionVariable =  Mage::getSingleton('core/session')->setYoursessionname('you session value');

// For Get custom session in Magento 
echo $getSessionVariable =  Mage::getSingleton('core/session')->getYoursessionname();

// For Unset custom session value in Magento 
  Mage::getSingleton('core/session')->unsYoursessionname();

 ?>