Fix issue where session would always be regenerated.

Fixes #2519
This commit is contained in:
mark_story 2012-01-29 15:37:14 -05:00
parent ca32ca185a
commit 4dd13ef554

View file

@ -633,14 +633,13 @@ class CakeSession {
$sessionConfig = Configure::read('Session');
if (self::_validAgentAndTime()) {
$time = $config['time'];
self::write('Config.time', self::$sessionTime);
if (isset($sessionConfig['autoRegenerate']) && $sessionConfig['autoRegenerate'] === true) {
$check = $config['countdown'];
$check -= 1;
self::write('Config.countdown', $check);
if (time() > ($time - ($sessionConfig['timeout'] * 60) + 2) || $check < 1) {
if ($check < 1) {
self::renew();
self::write('Config.countdown', self::$requestCountdown);
}