Originally posted by cube316
you mean the gc_probability is calculated in percentage??
and i wonder whether session.gc_maxlifetime means milliseconds or just seconds?
My copy of php.ini reads (in part):
; Percentual probability that the 'garbage collection' process is started
; on every session initialization.
session.gc_probability = 1
; 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 this computer is used as an internet host,millions of session temp files will be left each day,how should i do about that ?
don't tell me to clean by hand 🙁
First of all, that's unlikely to happen - with a gc_probability of 1 percent, there is a 1/100 likelihood that any given PHP script execution will clean up all files more than gc_maxlifetime seconds old. And since you need at least one PHP script execution to create a session temp file, the chances that none of those millions of session-file-creating script executions will be that one in a hundred that does a clean up are pretty small (you can figure out the odds for yourself).
If you are that worried, up the gc probability - it means that each script startup will be slower (on average, while they check for old session files), but lowering the gc maxlifetime increases the risk of dropping someone's session while they're still using it.