By default, the session lifetime is only 24 minutes, and cookies are stored until the browser is closed, such parameters are set on many hosting services.
This is not acceptable if you have an online store, because a customer can put products in the cart and return to the site in an hour or more, and the cart is already empty...
Time can be changed in .htaccess
Or PHP function ini_set()
; After this number of seconds, stored data will be seen as 'garbage' and ; cleaned up by the garbage collection process. ; http://php.net/session.gc-maxlifetime session.gc_maxlifetime = 172800 ; Lifetime in seconds of cookie or, if 0, until browser is restarted. ; http://php.net/session.cookie-lifetime session.cookie_lifetime = 172800
- 1 day = 86400 seconds
- 2 days = 172800 seconds
- 3 days = 259200 seconds
- 1 week = 604800 seconds