Comment 4 for bug 316441

Revision history for this message
Phil Bayfield (philio) wrote :

In the [Session] section of php.ini there is the following:

; 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.

; This is disabled in the Debian packages, due to the strict permissions
; on /var/lib/php5. Instead of setting this here, see the cronjob at
; /etc/cron.d/php5, which uses the session.gc_maxlifetime setting below
session.gc_probability = 1
session.gc_divisor = 100

The default for session.gc_probability in Ubuntu is 0.

What does work:

Using standard PHP stuff, keeping sessions stored in default path of /var/lib/php5

What doesn't work:

Changing session path to another folder either in php.ini or using an ini_set etc (although the cron job can be modified). (For example we use an NFS share for standard PHP sessions so sessions are valid accross multiple web servers.)
Using session_set_save_handler to modify default session storage functions of php.

Granted for most users the default functionality provided currently with php5 packages will be absolutely fine, but for larger, more complex and distributed PHP applications it breaks the functionality without modification back to php defaults.