Skip to content

Commit

Permalink
BUG: Fix for Cookie expiry timeout being passed as a large number on …
Browse files Browse the repository at this point in the history
…64 bit machines
  • Loading branch information
kmayo-ss committed Jun 20, 2013
1 parent a4189a6 commit dff5447
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions control/Session.php
Expand Up @@ -523,9 +523,11 @@ public static function start($sid = null) {

if(!session_id() && !headers_sent()) {
if($domain) {
session_set_cookie_params($timeout, $path, $domain, $secure /* secure */, true /* httponly */);
session_set_cookie_params($timeout, $path, $domain,
$secure /* secure */, true /* httponly */);
} else {
session_set_cookie_params($timeout, $path, null, $secure /* secure */, true /* httponly */);
session_set_cookie_params($timeout, $path, null,
$secure /* secure */, true /* httponly */);
}

// Allow storing the session in a non standard location
Expand All @@ -541,7 +543,8 @@ public static function start($sid = null) {
// Modify the timeout behaviour so it's the *inactive* time before the session expires.
// By default it's the total session lifetime
if($timeout && !headers_sent()) {
Cookie::set(session_name(), session_id(), time()+$timeout, $path, $domain ? $domain : null, $secure, true);
Cookie::set(session_name(), session_id(), $timeout/86400, $path, $domain ? $domain
: null, $secure, true);
}
}

Expand Down

0 comments on commit dff5447

Please sign in to comment.