Merge pull request #2127 from silverstripe-rebelalliance/cookietimestamp

BUG: Fix for Cookie expiry timeout being passed as a large number on 64 ...
This commit is contained in:
Ingo Schommer 2013-06-20 15:42:07 -07:00
commit 09ca497b36

View File

@ -523,9 +523,11 @@ class Session {
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
@ -541,7 +543,8 @@ class Session {
// 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);
}
}