Skip to content

Commit

Permalink
Fix issue where session would always be regenerated.
Browse files Browse the repository at this point in the history
Fixes #2519
  • Loading branch information
markstory committed Jan 29, 2012
1 parent ca32ca1 commit 4dd13ef
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/Cake/Model/Datasource/CakeSession.php
Expand Up @@ -633,14 +633,13 @@ protected static function _checkValid() {
$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);
}
Expand Down

0 comments on commit 4dd13ef

Please sign in to comment.