Use the below code to set and get Magento session values:

Setting and getting session values
Need help implementing this solution, or still looking for a fix to your Magento problem? Get in touch and I will be happy to help with your project.
Tags: