How to save value in my own session variable in Magento?

Posted by Editorial Staff | Updated on

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:

Now you want to echo the “welcome message” somewhere else in your code/site.


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.

Related Questions & Answers