Suppose I want access a varible one file to another file through session in magento.So please don’t use $_SESSION varible for that in magento.You just use the magento function for session like setSession(),getSession() and unsetSession().Magento uses great methods called setter and getter.So on that you can set and get your variable.

You just set a variable in file through session like PHP and acesss that on onther file on session.So there different methods available in magento for doing that.Please check below details

How set get unsetsession in magento

.I have a variable called $jyoti having value ‘testing session’.

that is $jyoti = ‘testing session’;

Set Session:

Get Session:

output will be ‘testing session’;

Unset Session:

There is different session available in magento like customer and core for frontend and adminhtml for backend.
for example:

How set get unsetsession in magento
Tagged on:     

Leave a Reply

Your email address will not be published. Required fields are marked *