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

Bug #1077 Session expires before the expected time
Submitted: 2004-03-26 16:42 UTC
From: rbaba99 at caramail dot com Assigned: troehr
Status: Closed Package: HTTP_Session
PHP Version: 4.2.2 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2004-03-26 16:42 UTC] rbaba99 at caramail dot com
Description: ------------ HTTP_Session with DB container: Setting the expire/Idle time with the function HTTP:_Session:setExpire / HTTP:_Session:setIdle to a value grater than the value of session.gc_maxlifetime in php.ini, has no effect on the session expire/Idle because the session will expire when the time is equal to the session.gc_maxlifetime value. Reproduce code: --------------- HTTP_Session::SetContainer('DB',$options); in_set('session.gc_maxlifetime',120); // 2 minutes HTTP_Session::start(); HTTP_Session::setExpire(time()+10*60); // expires in 10 minutes HTTP_Session::setIdle(time()+5*60); // Idle = 5 minutes Expected result: ---------------- Session expires/idles in 10minutes/5minutes Actual result: -------------- A session with the above setting will expires if it idles in 2minutes+1second .

Comments

 [2005-02-24 17:54 UTC] r dot php at instantox dot com
Experienced the same issue here. My current workaround is to set session.gc_maxlifetime to the same timeframe as my expiration. eg: $sess_time = 480; HTTP_Session::SetContainer('DB',$options); ini_set('session.gc_maxlifetime',$sess_time*60); HTTP_Session::start(); HTTP_Session::setExpire(time()+ ($sess_time*60)); Although it was confusing at first until I saw that the code was using the default gc_maxlifetime value from php.ini. It seems that the code should check the current session expiration (as set by setExpire??) and subtract that from the current time. -r -r
 [2005-09-02 21:13 UTC] torsten dot roehr at gmx dot de
This bug has been fixed in CVS. 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.