Want to save value in my own session variable in Magento? Let’s say you want to save the value “Hello world” to the “welcome message” variable in the session. The code would be:
$inputMessage = 'Hello World';
Now you want to echo the “welcome message” somewhere else in your code/site.
$outputMessage = Mage::getSingleton('core/session')->getWelcomeMessage();
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.