Re: Re: [PHP] Destroying session data
| From: | John Holmes | Date: | Thu, 23 Dec 2004 21:40:48 +0000 |
| Subject: | Re: Re: [PHP] Destroying session data | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-205109@lists.php.net to get a copy of this message | ||
From: Philip Thompson <prthomp@uark.edu>
> On Dec 23, 2004, at 2:59 PM, Matt M. wrote:
> > this might be coming into play:
> > http://us4.php.net/session
> >
> > session.gc_maxlifetime integer
> >
> > session.gc_maxlifetime specifies the number of seconds after which
> > data will be seen as 'garbage' and cleaned up.
>
> Okay, lemme see if I understand how it works. Even if it "sees" it as
> garbage, it will not destroy it until the session has ended? or will
> destroy when that time is reached? So can I set session.gc_maxlifetime
> to be a low number (e.g., 10 seconds) and it will still behave
> appropriately? Currently, it's set to the default - 1440.
The gc_maxlifetime setting controls how "old" files can be before the garbage collection
process deletes them, when it's actually started. This is why your file system must support
atime as mentioned before. If the file has not been accessed in over 1440 seconds (by default) then
if the garbage collection process is started, it'll be deleted.
Like I said in my other post, though, there's only a 1% chance of the garbage collection
process being started (by default). These old files you see are probably there because you
don't have enough traffic to trigger garbage collection or your using a file system that
doesn't support atime.
---John Holmes...
UCCASS - PHP Survey System
http://www.bigredspark.com/survey.html