That last statement was not entirely true.

The server does not have to know when someone leaves to clean up.

You are right about session.gc_maxlifetime and session.gc_probability.

if the maxlifetime is set to 1200 (20 minutes) and the probability is set to
1 that means that one percent of the time there is session activity on the
server it will perform the garbage clean up routine. If you set probability
to 100 then every time someone refreshed or loaded a page that used sessions
php will look through the session data and remove anything that's older than
our 20 minute maxlifetime.

As for your problem, I do not know what to tell you except that you might
look for an alternative to file type sessions. It is true that php will not
perform garbage clean up if the path is beyond two dirs up from root. MySQL
is a popular alternate choice because it's fast and more secure than any
file that is world readable.

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
----- Original Message -----
From: "Lars Olsson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 30, 2002 12:09 PM
Subject: [PHP] Re: A somewhat unusual session question...


> I'm aware that the server cannot "know" whenever a user just quits
> without logging out, but I was under the impression that the flags
> session.gc_maxlifetime and session.gc_probability in php.ini would
> control when and how often "leftover" session files would be removed. If
> this isn't true, what are these flags actually used for? Pretty
> confusing if you ask me...
>
> /lasso
>
>
>
> Scott Fletcher wrote:
> > The session.save_path have nothing to do with it.  I have that same
problem
> > with the default path, "/tmp" when the session became a garbage
collection
> > when the user quit the browser without logging off.  When the user quit
the
> > browser then there's no way for the server to know that, so the session
> > stuffs stay active in the session.save_path.  You will have to either
> > manually clean it up weekly or use crontab to do the clean up for you at
> > night-time with the time-range the website is off-limit to the user.
This
> > is where people do the maintaince also.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to