Re: Set Logout Time for No Activity
| From: | Ignatius Reilly | Date: | Fri, 20 Dec 2002 13:09:44 +0000 |
| Subject: | Re: Set Logout Time for No Activity | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-24308@lists.php.net to get a copy of this message | ||
Another possibility is after each page call to rewrite the client's cookie's validity to,
say, current time + 1800s:
session_start() ;
setcookie( session_name(), session_id(), time()+1800, "/" ) ;
ob_start() ;
// etc.
If the user does not call a page for more than 30', the cookie will be destroyed, in effect
destroying the session.
Ignatius
____________________________________________
----- Original Message -----
From: John W. Holmes
To: 'Allens' ; php-db@lists.php.net
Sent: Friday, December 20, 2002 1:57 PM
Subject: RE: [PHP-DB] Set Logout Time for No Activity
> Is there a variable in php.ini that will allow you to log someone
out
> if there is no activity of 30 minutes or greater from the logged in
> user? Thanks in advance. :)
No, not really. You can use sessions, for something like this, though.
You start a session and look for a variable within it before you proceed
with the page. If the user is inactive for a while, the session will be
cleaned up and not exist when you go to check it, so you make them log
in again. You can control the session garbage collection time in
php.ini.
---John Holmes...
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php