Hi all. I'm wondering if anyone can tell me how long temporary session files stay on the server after the session has ended if session_destroy() is not called.
AFAIK, this depends on two php.ini directives:
---
; Define the probability that the 'garbage collection' process is started
; on every session initialization.
; The 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 request.
session.gc_probability = 1 session.gc_divisor = 100
; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
session.gc_maxlifetime = 1440
---
If you still need a little clarification, after 1440 seconds (24 mins) of an inactive session, the session will be seen as garbage. BUT the probability of the garbage collection taking place is reliant on the the 1% (in the above case) chance that garbage collection should take place. On a busy server, this means that garbage will be thrown out almost straight after the 1440 seconds are up, but on a very quiet server, you might need to change the 1/100 to something like 2/100 (2%) or even more.
What I'm curious about is how long these last before they are somehow deleted? Is there some way I can control this?
Modify the php.ini and test.
session.gc_probability and session.gc_maxlifetime can also be modified via ini_set() or a .htaccess file.
http://au3.php.net/ini_set
Justin French
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php