Sep 2, 2014
kalpesh

Magento set session cookie lifetime to 1 day

Is your Magento shopping cart kicking out all the items after 24 minutes? Are you frustrated because your customer’s cart items are getting flushed every few hours even though you have correct setting in Magento? Do you want to increase your shopping cart sessions to last for 1 day (or anything you wish)?

Here are the things to look for to increase/decrease Magento’s session cookie lifetime.

In your php.ini file:

session.gc_maxlifetime 86400

If you have not changed this, it should be by default 1440 i.e. 24 minutes. Change it to 86400 for one day session lifetime

In your Magento admin:

System -> Configuration -> Checkout -> Shopping Cart
Quote Lifetime (days) -> 1
System -> Configuration -> Web -> Session Cookie Management
Cookie Lifetime -> 86400

Make sure to check if you are in correct website/store if using multi-website/multi-store Magento setup. You can change the scope by changing the website/store from the upper left Store Switcher drop down in System -> Configuration screen.

If you are changing php.ini value, make sure you reload apache to reflect the changes.

4 Comments

  • Very useful post… thanks a lot !

  • Thank you for summary this effective solution to this recurring magento issue!

  • Thanks for putting this together. I am surprised that there are magento stores who have not implemented this. This directly impacts all the marketing campaigns.

  • I am pretty new to magento but May I know that the above setting will work for non logged in user ? If not then what should be the approach.

Leave a comment

 

Welcome to my Blog

Kalpesh MehtaHelping Magento developers in their day-to-day development problems since 2011. Most of the problems and solutions here are my own experiences while working on different projects. Enjoy the blog and don't forget to throw comments and likes/+1's/tweets on posts you like. Thanks for visiting!

Certifications

Honor

Recognition

Magento top 50 contributors

Magento top 50 contributors

Contributions