Re: sessions timeout

From: Date: Tue, 09 Mar 2004 23:12:58 +0000
Subject: Re: sessions timeout
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-179944@lists.php.net to get a copy of this message
Hello André, Tuesday, March 9, 2004, 10:53:35 PM, you wrote: AVL> I'm using sessions to manage users, by using cookies to store the AVL> session. AVL> My question is, how do I make the session last _forever_? AVL> ATM the session lasts 'till the user closes the browser. Ok first of all - you cannot make a cookie last "forever". You can set its expiry to be a ridiculous date in the future, but that's all - if the browser removes it during cookie purging, or the user reinstalls something - it's gone. One of the best solutions is to refresh the cookie (without their knowledge) each time they come back to the site. Anyway, onto the meat of your question - give the cookie an expiry date well into the future so it persists until the visitor returns. Look at the help file for details on the attributes you need for setcookie. -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html

« previous php.general (#179944) next »