|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71349 Garbage collection not running
Submitted: 2016-01-12 11:03 UTC Modified: 2016-08-30 10:19 UTC
From: Assigned: yunosh (profile)
Status: Closed Package: Session related
PHP Version: master-Git-2016-01-12 (Git) OS: Linux
Private report: No CVE-ID: None
 [2016-01-12 11:03 UTC]
Looks like the GC settings don't work properly, or GC doesn't work at all on 7.1.0-dev.

Test script:
ini_set('session.gc_probability', 100);
ini_set('session.gc_divisor', 1);
ini_set('session.gc_maxlifetime', -1);

Expected result:
All sessions should be GC'ed

Actual result:
They aren't.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-01-12 12:00 UTC]
Test with unit tests:

$ sudo pear -d auto_discover=1 install -o -f channel:// channel:// channel://
$ php $(pear config-get test_dir)/Horde_SessionHandler/Horde/SessionHandler/AllTests.php
 [2016-08-27 06:29 UTC]
-Status: Open +Status: Feedback
 [2016-08-27 06:29 UTC]
I don't see problem with current PHP-7.0/7.1 branches. 

Are you sure your system is using other save handlers like memcache, etc?
Use following script. You should see undefined var error always if PHP is working correctly.

ini_set('session.save_handler', 'files');
ini_set('session.gc_probability', 1);
ini_set('session.gc_divisor', 1);
ini_set('session.gc_maxlifetime', -1);
 [2016-08-27 06:30 UTC]
Are you sure your system is NOT using other save handlers like memcache, etc?
 [2016-08-30 10:19 UTC]
-Status: Feedback +Status: Closed -Assigned To: +Assigned To: yunosh
 [2016-08-30 10:19 UTC]
Looks like this has been fixed in the meantime.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Jan 30 15:03:49 2023 UTC