I've received some conflicting information online about this, but when enabling Magento's native Persistent Shopping Cart is it necessary to also modify the php value for session.gc_maxlifetime to match the time in seconds?

For example, if you look at this third party module on GitHub:


You'll see it mentions:

This extension works by extending the lifetime of cookies, in all likelihood your server will also need to extend the lifetime of it's sessions. To do this add the following to the site's .htaccess file:

php_value session.gc_maxlifetime 2592000

Do I need to change the PHP value, or will it function regardless?

1 Answer 1


For persistent shopping cart you should not need to. Works only when customer is logged in.

But for regular guest browsing and admin sessions you need to.

  • Thanks for the info. If I also wanted to extend the guest cart persistence, should I also increase the cookie lifetime to match this at System → Config → Web → Session Cookie Management?
    – Moose
    Mar 9, 2015 at 11:06
  • 1
    Exactly, and match that or exceed that with the GC setting. You can also lengthen your admin setting under admin>system>config>admin. Please accept above answer if it resolves your query. Thank you.
    – ladle3000
    Mar 9, 2015 at 11:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.