There are 3 settings which affect the life time of PHP sessions, which can be set in php.ini
or in .htaccess
. A sample from .htaccess
is:
# Sessions
php_value session.gc_probability 1
php_value session.gc_divisor 100
php_value session.gc_maxlifetime 600
I understand that this means that after 600 seconds, the session may be destroyed. The probability
and divisor
settings are supposed to determine how soon.
I also understand that this means that the session above has 1 in 100 chance of being destroyed; the divisor should be lower for quiet servers and higher for busy servers to balance between overworking the server and destroying the session in a timely fashion.
The question is why are there both settings? I have never seen the probability setting to anything other than 1.