Is there a maximum timeout that we can set for the session cookie? Can I set it up to 1 year for example?
1 Answer
As written on stackoverflow by Joeri Hendrickx
All cookies expire as per the cookie specification, so this is not a PHP limitation.
Use a far future date. For example, set a cookie that expires in ten years:
setcookie( "CookieName", "CookieValue", time() + (10 * 365 * 24 * 60 * 60) );
Note that if you set a date past 2038 in PHP, the number will wrap around and you'll get a cookie that expires instantly.
-
Is it possible to go the Magento Backend and in Session Cookie Management/Cookie Lifetime set that value (10 * 365 * 24 * 60 * 60 = 315360000)? Will it work?– nanoJun 7, 2016 at 21:05
-
setcookie("cookiename",'somevalue',time()+31556926 ,'/');