php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13173 no gc even when gc_probablity = 100
Submitted: 2001-09-06 07:09 UTC Modified: 2001-12-14 06:20 UTC
From: php-jp at typhoon dot co dot jp Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.0.6 and 4.10 OS: FreeBSD 4.X
Private report: No CVE-ID: None
 [2001-09-06 07:09 UTC] php-jp at typhoon dot co dot jp
settings in php.ini:

   session.save_handler   = files
   session.gc_probability = 100
   session.gc_maxlifetime = 120

Problem:

User1 was assigned session_id()=somesessionid01.
Session variables are saved properly.  User1 bookmarked the page.

If NO ONE else has visited the site and started another session, then User1 can return and revive the session no matter how much time is passed (over the gc_maxlifetime value,) when he/she visits the pages again with an URL like:

   http://site.site.site/some.php?SID=somesessionid01

However, if another user visits the site, gets another session id, e.g. somesessionid02 BEFORE User1 returns with the said URL, then, garbage collection occurs and data are deleted properly.

Conclusion:

   Garbage collection is *not* done when the same session_id    returns BEFORE another session_id is generated.  This       happens when the session.save_handler = files

   However if:

      session.save_handler   = user

   where 'user' is a customized handler, the relevant          sess_gc routine is called properly and gc is taken care    of.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-13 02:52 UTC] php-jp at typhoon dot co dot jp
Just tried this with 4.1.0 and found that the problem has not been resolved.
---ends---

 [2001-12-13 04:58 UTC] yohgaki@php.net
What kind of user session handler you have?
You have reported Bug ID: 13078 also.
Don't paste script, but please explain a bit.

Also have to check your httpd and php error log?
Is there anything interesting?

 [2001-12-13 05:08 UTC] yohgaki@php.net
Looks like I don't know what I'm thinking.

Also have to check your httpd and php error log?
Is there anything interesting?

should be

Also have *you* check your httpd and php error logs?
Is there anything interesting?


 [2001-12-13 05:26 UTC] php-jp at typhoon dot co dot jp
My customed sess_write stores stuff to PostgreSQL 7.1.x  I simply ported one I found on the Net some which saved stuff my MySQL.  

Anyhow, with the garbage collection problem (bug#13173) the problem is NOT with my customed script because everything works fine with my handlers.  (OK, I had to set "register_globals = on" as per my report in bug #13078, but at least it worked!) 

The problem is with 

   session.save_handler   = files

(as with the original problem description.)

As for error logs, yes, I have checked my httpd_error_log file and found nothing:(  In fact, I have also set:

   error_log = syslog

too and nothing there either:(

TIA, for your patience and help.
---ends---
 [2001-12-13 07:09 UTC] yohgaki@php.net
You are using PostgreSQL, try my session handlers can be found at Zend.com. If session works as expected, it's your session handler's bug.

http://www.zend.com/codex.php?id=456&single=1
 [2001-12-13 07:16 UTC] php-jp at typhoon dot co dot jp
Thank you for the code sample and I'll try it for #bug #13078. 

So, no verdict yet for this->bug#13173?

Thanks again.
---ends---

 [2001-12-14 06:20 UTC] yohgaki@php.net
File handler has some limitation.
I hope my note in manual page is not deleted ;)
(i.e. Please take a look at notes in PHP manual)


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 17:01:31 2024 UTC