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

it is very easy to set get and unset your custom session 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();

 ?>

No comments:

Post a Comment