[Tickets #1658] RESOLVED: setting session timeout to non-zero expires
sessions immediately
bugs at bugs.horde.org
bugs at bugs.horde.org
Fri Apr 1 07:45:21 PST 2005
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.
Ticket URL: http://bugs.horde.org/ticket/?id=1658
-----------------------------------------------------------------------
Ticket | 1658
Updated By | amy.rich at tufts.edu
Summary | setting session timeout to non-zero expires sessions immediately
Queue | Horde Base
Version | 3.0.2
State | Bogus
Priority | 2. Medium
Type | Bug
Owners |
-----------------------------------------------------------------------
amy.rich at tufts.edu (2005-04-01 07:45) wrote:
I read the URL that accompanied the timeout option, and what it appears to
say is that it should be the time in seconds that the cookie should live,
not the current time plus the number of seconds the cookie should live. The
entry quoted below seems to state this rather plainly (if this comment is
incorrect, then the documentation should reflect this, or a note should be
made for the timout option):
The first argument to session_set_cookie_params is the number of seconds in
the future (based on the server's current time) that the session will
expire. So if you want your sessions to last 100 days:
$expireTime = 60*60*24*100; // 100 days
session_set_cookie_params($expireTime);
I was using time()+$expireTime, which is WRONG (a lot of the
session_set_cookie_params() examples I found get this wrong, but probably
don't care because they are just doing "infinite" sessions).
More information about the bugs
mailing list