On Wed, 24 Sep 2003 11:42:12 +0200 Cranky <[EMAIL PROTECTED]> wrote: > Hello, > Is it possible to determine a lifetime for the session in the case > of a cookie-less sessions ? > > Thanks for your help. >
In my sessions I set an "expire time", which is the current time (unix timestamp) plus the number of seconds I want a session to last. Each new page examines the current timestamp against the expire time. If the current time is less than the expire time, then the expire time is advanced again. Otherwise, the session is wiped out and the user sent to an error page. ======== $defExpireTime = 3600; if ($_SESSION['expire'] <= (time() + $this->defExpireTime) { $_SESSION['expire'] = time() + $this->defExpireTime; # go ahead with session } else { $_SESSION = array(); # send the user to an error page } -- Raquel ============================================================ What lies behind us and what lies between us are tiny matters compared to what lies within us. --Oliver Wendell Holmes -- Raquel ============================================================ What lies behind us and what lies between us are tiny matters compared to what lies within us. --Oliver Wendell Holmes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php