RE: [PHP] Can I rely on session.gc_maxlifetime?
| From: | Johnson, Kirk | Date: | Tue, 25 Sep 2001 14:19:17 +0000 |
| Subject: | RE: [PHP] Can I rely on session.gc_maxlifetime? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-68709@lists.php.net to get a copy of this message | ||
> So, no matter if the user is still working, the session will be
> destroyed. I mean session.gc_maxlifetime isn't
> session.gc_maxIDLEtime?
Every time the user requests a page in an application using sessions, the
session file's access time gets updated. The garbage collection routine
looks at that access time. If the file hasn't been accessed less than
gc_maxlifetime seconds ago, the gc routine deletes the session file. Another
factor comes into play, tho, that is session.gc_probability. This sets how
often the gc routine is launched. The default value is 1%, which means that
on 1 of every 100 page requests the gc routine launches. So, if the server
is not getting many hits, it can be a long time before the gc routine
launches, so the session file can hang around longer than gc_maxlifetime.
Kirk