[#1302] incorrect cookie expiration times
Summary incorrect cookie expiration times
Queue Horde Base
Queue Version 3.0.2
Type Bug
State Resolved
Priority 2. Medium
Owners Horde Developers (at)
Requester m.zdila (at) episoftware (dot) com
Created 2005-02-03 (5828 days ago)
Updated 2005-04-02 (5770 days ago)
Assigned 2005-04-02 (5770 days ago)
Resolved 2005-04-02 (5770 days ago)
Patch No

2005-04-02 05:40:09 Chuck Hagenbuch Comment #4
State ⇒ Resolved
Reply to this comment
Okay, this should be correct in Horde 3.0.5.
2005-04-02 05:26:39 Chuck Hagenbuch Assigned to Horde DevelopersHorde Developers
2005-04-02 05:26:19 Chuck Hagenbuch Comment #3
State ⇒ Assigned
Priority ⇒ 2. Medium
Reply to this comment
This wasn't the right fix; we use the timeout value elsewhere when it 
*is* relative. Reopening.
2005-02-03 16:39:58 Jan Schneider Comment #2
State ⇒ Resolved
Reply to this comment
We don't say anywhere that the value entered there is the expiration 
interval. Instead we even point to the setcookie() documentation 

OTOH it doesn't make sense to enter a fixed value (integer) here, 
because you most likely want to always have a dynamic value there. 
Thus I changed the configuration type so that you now can enter PHP 
code there.
2005-02-03 14:14:22 m (dot) zdila (at) episoftware (dot) com Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 3. High
Summary ⇒ incorrect cookie expiration times
Queue ⇒ Horde Base
Reply to this comment
In the file lib/Horde/Secret.php you use many times:

@setcookie($keyname . '_key', $key, $conf['session']['timeout'], 
$conf['cookie']['path'], $conf['cookie']['domain'], $conf

['use_ssl'] == 1 ? 1 : 0);

But the setcookie function expect absolute time of cookie expiration, 
not relative. Therefore the correct form should be:

@setcookie($keyname . '_key', $conf['session']['timeout'] == 0 ? 0 : 
$key, time() + $conf['session']['timeout'], $conf['cookie']['path'], 
$conf['cookie']['domain'], $conf

['use_ssl'] == 1 ? 1 : 0);

Am I right? I lost about 5 hours :-/ to find a problem why the IMP 
application forever reloads when I use cookies. Only MSIE worked (it 
kept the cookie with the time in the past).

Saved Queries