Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.7.3

Request #16923 Allow a setter to determine cache expiry
Submitted: 2009-12-18 10:25 UTC Modified: 2011-03-11 18:47 UTC
From: mlaak Assigned: till
Status: Closed Package: HTTP_Session2
PHP Version: 5.1.1 OS: linux
Roadmaps: 0.8.0    
Subscription  


 [2009-12-18 10:25 UTC] mlaak (Martin Laak)
Description: ------------ In HTTP_Session_Container_Memcache:write the expire date is calculated as follows: time() + ini_get('session.gc_maxlifetime') Now when server clocks should be different (I had such a case lately), we get a bug that is very hard to detect. In http://www.php.net/manual/en/function.memcache-set.php expire: ..... You can also use Unix timestamp or a number of seconds starting from current time, but in the latter case the number of seconds may not exceed 2592000 (30 days). So if ini_get('session.gc_maxlifetime')<2592000 then it should be 0++ ini_get('session.gc_maxlifetime') to make use of memcache server time.

Comments

 [2009-12-18 10:37 UTC] mlaak (Martin Laak)
I meant 0+ini_get('session.gc_maxlifetime')
 [2009-12-20 13:21 UTC] doconnor (Daniel O'Connor)
-Summary: Unvise use of memcache +Summary: Allow a setter to determine cache expiry
I'd suggest implementing some kind of way to setTime() around here might not hurt - if not nothing else, just to make it more unit testable.
 [2010-09-03 11:27 UTC] doconnor (Daniel O'Connor)
-Status: Open +Status: Feedback -Package: HTTP_Session +Package: HTTP_Session2
Given HTTP_Session2 superceeds HTTP_Session, is this feature request still relevant? If not, we should close this.
 [2010-09-03 12:02 UTC] till (Till Klampaeckel)
-Status: Feedback +Status: Verified -Roadmap Versions: +Roadmap Versions: 0.8.0
Wait, people need a workaround in a class when the server time is broken? The fix is called NTP in this case. :D In all seriousness though - setTime(), getTime() is a good idea for unit testing. I'll see to it for the 0.8.0 release. @Daniel: I'll email you when it's in trunk so you can verify it to your liking.
 [2010-09-03 12:42 UTC] till (Till Klampaeckel)
-Status: Verified +Status: Feedback
Hey guys, I committed some additions: http://svn.php.net/viewvc?view=revision&revision=303025 Please check it out and let me know what you think. Till
 [2011-03-11 18:47 UTC] till (Till Klampaeckel)
-Status: Feedback +Status: Closed -Assigned To: +Assigned To: till
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.