views:

53

answers:

1

I'm running a Magento based website store on Linux/Apache.

In order that user logins are maintained, I've set my cookie lifetime to be close to two years. The cookies are sent out with the right times, I can see them in my browsers. When I visit the site from a previously logged-in browser after about a day, the user is logged out. I can still see the cookies, with their extended life, present in the browser.

Where should I start looking to get to the bottom of this issue?

+1  A: 

Have you checked the value of PHP's session.gc_maxlifetime parameter? Regardless of the life that Magento allows, this lifetime setting will still kill cookies after a little while. In your .htaccess file in the magento directory, add this:

php_value session.gc_maxlifetime 31536000

That may solve the problem.

Hope that helps!

Thanks, Joe

Joseph Mastey
Good idea. I found that this value was quite small (3600) in my php.ini. I changed it to the value you suggested - a year. Found that I'm still logged out this morning, though. Something else must be afoot.
Laizer
By chance is the computer set to expire cookies or use some other type of privacy option?
Joseph Mastey
Your first answer was the right one. Once I changed the value in php.in and *restarted Apache* (:smack:), it's behaving appropriately. Many thanks.
Laizer