Re: [PHP] Re: A somewhat unusual session question...

2002-07-30 Thread Tech Support

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




[PHP] Re: A somewhat unusual session question...

2002-07-30 Thread Lars Olsson

Hm...seems it works after all...Tried extremely short 
session.gc_maxlifetime and a 100% session.gc_probability...works like a 
charm! Sorry for not checking this thoroughly enough before whining... ;)

/lasso ([EMAIL PROTECTED])



Lars Olsson wrote:
> Hi all!
> 
> The manual claims here (http://se2.php.net/manual/en/ref.session.php) that:
> 
> 
> ...If session.save_path's path depth is more than 2, garbage collection 
> will not be performed.
> 
> 
> Anyone know why this is the case? And can you get around it? My scripts 
> currently lives on a shered server and I wanted to get away from using 
> /tmp (which is the default). I changed the session_save path in my 
> .htaccess file to:
> 
> /home/httpd/vhosts/mydomainname/httpdocs/sessions/
> 
> and created some sessions. The creation and destruction of sessions 
> works fine as long as the user logs out correctly, but PHP fails to 
> garbage collect sessions when the user just quits the browser. I've 
> tried changing the session.gc_probability to 100 (and waited until 
> session.gc_maxlifetime had passed), but it still doesn't work. Now I'm 
> stuck with a bunch of "deserted" session files that don't seem to go 
> away. Any ideas on how to solve this?
> 
> /Lasso ([EMAIL PROTECTED])
> 


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




[PHP] Re: A somewhat unusual session question...

2002-07-30 Thread Lars Olsson

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] Re: A somewhat unusual session question...

2002-07-30 Thread Scott Fletcher

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.

"Lars Olsson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi all!
>
> The manual claims here (http://se2.php.net/manual/en/ref.session.php)
that:
>
> 
> ...If session.save_path's path depth is more than 2, garbage collection
> will not be performed.
> 
>
> Anyone know why this is the case? And can you get around it? My scripts
> currently lives on a shered server and I wanted to get away from using
> /tmp (which is the default). I changed the session_save path in my
> .htaccess file to:
>
> /home/httpd/vhosts/mydomainname/httpdocs/sessions/
>
> and created some sessions. The creation and destruction of sessions
> works fine as long as the user logs out correctly, but PHP fails to
> garbage collect sessions when the user just quits the browser. I've
> tried changing the session.gc_probability to 100 (and waited until
> session.gc_maxlifetime had passed), but it still doesn't work. Now I'm
> stuck with a bunch of "deserted" session files that don't seem to go
> away. Any ideas on how to solve this?
>
> /Lasso ([EMAIL PROTECTED])
>



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