Re: session expires

From: Date: Tue, 13 Jan 2004 13:41:58 +0000
Subject: Re: session expires
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-174440@lists.php.net to get a copy of this message
A tricky way to achive this is: 1. Start the session when the user request the login page 2. Send a hidden field with the PHPSESSID 3. When receiving the post compare the current session id with the submitted by the form, if they match it's likely the session has not expired. Other solution: If you can do it, to put an IFRAME with a page which autorefresh itself by less than the time the session expires. Manu. "Andreas Magnusson" <amag@home.se> wrote in message news:20040113014054.15100.qmail@pb1.pair.com... > Hi, I wonder if anyone knows of a way to detect if a session has expired > (when your session.cookie_lifetime != 0). > I've tried to see if the session-vars are unset, but that doesn't seem to be > the case, still everythings seems to be lost. > My problem is that I have a page which the user must log in to in order to > access it (I use sessions for this). > This page contains a form which may take some time to fill in. > Now the session may expire during this time and all data will be lost. > My plan is to allow the user to login again without losing the data but this > requires me to know if the session has expired. > > Thanks in advance! > Andreas

« previous php.general (#174440) next »