note 61117 deleted from ref.session by danbrown
| From: | danbrown@php.net | Date: | Sun, 20 Jul 2008 18:23:05 +0000 |
| Subject: | note 61117 deleted from ref.session by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-142220@lists.php.net to get a copy of this message | ||
Note Submitter: james dot ellis at gmail dot com
----
If you are wondering why your garbage cleanup method is not being called, read on.
The manual notes for garbage cleanup state that the session.gc_divisor defaults to 100:
[code]
//http://php.net/manual/en/ref.session.php
session.gc_probability ... Defaults to 1.
session.gc_divisor .... session.gc_divisor defaults to 100.
[/code]
This would provide a gc probability of 1 in 100 ie. your garbage cleanup is going to be called 1% of
the time.
Conversely, my PHP 5.1.1 install, compiled from source, contains this in the php.ini-recommended
file (and my php.ini file):
[code]
; 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 = 1000
[/code]
A 0.1% probability by default. Based on the information provided, I set my gc_probability to 100,
thus providing a 1% probability stale sessions would be culled.
Moral:your local php.ini may differ from what the manual provides.