Re: [PHP] Intelligent "session_destroy()"

2005-09-22 Thread Ondrej Ivanič

Ken Tozier wrote:
I'm writing a bunch of scripts that will all use a common session and  
am a bit confused about when to manually destroy sessions and/or when  
php automatically destroys them for me. For example:


If a user starts a session, leaves their computer on and goes home  for 
the weekend, when they come back on Monday will their session  still 
exist on the server? Could they pick right up where they left off?


don't care and only sets

session.gc_maxlifetime
session.gc_divisor
session.gc_probability

to correct values.

When you call session_start php sometimes runs garbage collector which 
remove old sessions. Probability is calculated by using 
gc_probability/gc_divisor e.g. 1/100 means there is a 1% chance that the 
GC process starts on each session_start(). If you set probability to 
100% GC will run on every session_start(). This is good for testing but 
not for production environment (default value (1%) is enough).


Sessions which is last modified (before php 4.2.? was used last access 
time) before current time minus gc_maxlifetime is a old session and will 
be deleted.


--
Ondrej Ivanic
([EMAIL PROTECTED])

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



[PHP] Intelligent "session_destroy()"

2005-09-22 Thread Ken Tozier
I'm writing a bunch of scripts that will all use a common session and  
am a bit confused about when to manually destroy sessions and/or when  
php automatically destroys them for me. For example:


If a user starts a session, leaves their computer on and goes home  
for the weekend, when they come back on Monday will their session  
still exist on the server? Could they pick right up where they left off?


Thanks

Ken

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