note 31209 added to ref.session
| From: | onp at home dot se | Date: | Sun, 13 Apr 2003 22:32:18 +0000 |
| Subject: | note 31209 added to ref.session | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-46576@lists.php.net to get a copy of this message | ||
In response to "shanemayer42@yahoo.com" on the garbage collector.
You can make it work... like this:
session_start();
$session_timeout = 10; // number of seconds till timeout
if (isset($_SESSION['last_access']) && $_SESSION['last_access'] <
(time() - $session_timeout)) {
session_destroy();
} else {
$_SESSION['last_access'] = fileatime('/path/to/sessions/sess_' .
session_id());
}
--
http://www.php.net/manual/en/ref.session.php
http://master.php.net/manage/user-notes.php?action=edit+31209
http://master.php.net/manage/user-notes.php?action=delete+31209
http://master.php.net/manage/user-notes.php?action=reject+31209