Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set session time out limit for magento frontend

Tags:

magento

I am trying to set session time out limit to 30 minutes in magento but it is not expiring in 30 minutes. I went to System->Configuration->Web->Session Cookie management and set 1800 value for the field Cookie Life time but still it is not expiring the session in specified time out limit. I don't know what is wrong with Magento frontend session.

Am I setting the limit at right place? Is there any other setting in magento backend to set the frontend session time out limit.

like image 332
Shakti Singh Avatar asked Oct 26 '10 10:10

Shakti Singh


3 Answers

This can also be achieved from the admin panel without touching a single line of code.

Go to System->Configuration->Advanced->Admin->Security and set the session lifetime to how many seconds you wish. I always set it to one day (86400 seconds) on my development environment.

enter image description here

System->Configuration->Web->Session Cookie management is for setting the timeout for normal users, signing into their profile & not the admin panel.

like image 50
Holly Avatar answered Sep 23 '22 21:09

Holly


I had this issue with the Magento admin session . The crux of the problem is that Magento's cookies obey PHP's session.gc_maxlifetime parameter. If you adjust that in your htaccess like the following, you should have better luck:

php_value session.gc_maxlifetime 86400

Hope that helps!

Thanks, Joe

like image 36
Joe Mastey Avatar answered Sep 22 '22 21:09

Joe Mastey


I found out what I was missing.

I was setting the cookie life time for default configuration but it did not work.

But this also needs to set the time out in website and store configuration scope.

After setting the time for these scopes it worked.

like image 26
Shakti Singh Avatar answered Sep 24 '22 21:09

Shakti Singh