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
The following two tabs change content below.
Jyotiranjan is one of passionate programmer who has been working in magento since 6 years and in the mean time he has developed enormous amount of modules and customisation of sites. He loves to write blogs and travel for long journeying.

Latest posts by Jyotiranjan Biswal (see all)

Tagged on:     

Leave a Reply

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