RE: [PHP] How long does a session last? Need to have it at 20mins
| From: | Johnson, Kirk | Date: | Fri, 19 Apr 2002 13:49:39 +0000 |
| Subject: | RE: [PHP] How long does a session last? Need to have it at 20mins | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-93695@lists.php.net to get a copy of this message | ||
Garbage collection is launched according to the gc_probablility. If it finds
a session file that has not been modified for a longer time than
gc_maxlifetime, it deletes it. So, whenever a user requests a page, they
essentially reset the session timer to zero for that particular session,
since the session file gets modified on each page request for that session.
If you want to set a hard timeout of 20 minutes, you may need to write your
own garbage collection process.
Kirk
> -----Original Message-----
> From: Phil Powell [mailto:soazine@erols.com]
> Sent: Friday, April 19, 2002 1:02 AM
> To: php-general@lists.php.net
> Subject: [PHP] How long does a session last? Need to have it at 20mins
>
>
> I had thought that a session would last only 20 mins if
> session.gc_maxlifetime is set at 1440. Was I wrong in
> assuming this? I
> have pages that have session_start() at the top to persist the session
> throughout the life-cycle of these pages, however, I want the
> session to
> expire after 20 mins or so of use. How can I assure that the
> session will
> expire after 20 mins?
>
> Thanx
> Phil