Edit report at http://bugs.php.net/bug.php?id=55048&edit=1
ID: 55048
User updated by: kvonlaven at yahoo dot com
Reported by: kvonlaven at yahoo dot com
Summary: Garbage is Never Collected
-Status: Open
+Status: Closed
Type: Bug
Package: Session related
Operating System: CentOS 5.3
-PHP Version: Irrelevant
+PHP Version: 5.2.6-1+lenny10
Block user comment: N
Private report: N
New Comment:
I just got it to work. It turns out the settings in php.ini were being
completely ignored and
overwritten with the following values:
session.gc_probability = 0
session.gc_divisor = 100
session.gc_maxlifetime = 1440
Understandbly this meant the garbage was never being collected. This is a
little surprising
because I thought the default value of session.gc_probability was supposed to
be 1. In any case,
the reason my php.ini settings were being ignored is that I didn't put quotes
around the string I
assigned to a different ini variable.
Previous Comments:
------------------------------------------------------------------------
[2011-06-13 21:26:37] kvonlaven at yahoo dot com
Description:
------------
I'm using PHP version 5.2.6-1+lenny10. I would upgrade or try using an SVN
snapshot if I could, but I don't have administrator privileges on the server
I'm
using :-/.
Below is an excerpt from my php.ini file.
session.gc_probability = 1
session.gc_divisor = 1
session.gc_maxlifetime = 3600
I also have a call to session_save_path('Session Data') and
ini_set('session.gc_maxlifetime', 3600) right before session_start() gets
called.
These three functions get called at the top of every page before any output is
sent from the server.
Test script:
---------------
I executed the following script to verify that PHP has the appropriate
privileges to delete temporary session files, and it deleted the file as
expected.
<?php
unlink('Session Data/name_of_arbitrary_session_file');
?>
Expected result:
----------------
My understanding is that, using this configuration, the garbage collector
should
completely delete all temporary session files in the "Session Data" directory
that
are over an hour old every time anybody goes to any page on the site.
Actual result:
--------------
I have empty temporary session files in the "Session Data" folder that are
several
days old but have yet to be deleted.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=55048&edit=1