Skip to content

Commit

Permalink
Moving a few things around to better replicate how CakeSession behave…
Browse files Browse the repository at this point in the history
…d in 1.3. Also fixes the countdown & session id regeneration feature. Still need to write a test case for it though.
  • Loading branch information
markstory committed Jul 28, 2010
1 parent d2097c5 commit 81f6f43
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cake/libs/cake_session.php
Expand Up @@ -153,10 +153,9 @@ public static function init($base = null, $start = true) {
if ($start === true) {
self::_setPath($base);
self::_setHost(env('HTTP_HOST'));
self::start();
}
if (isset($_SESSION) || $start === true) {
self::$sessionTime = self::$time + (Configure::read('Session.timeout') * 60);
self::start();
}
}

Expand Down Expand Up @@ -233,12 +232,12 @@ public static function start() {
if (self::started()) {
return true;
}

$id = self::id();
session_write_close();
self::_configureSession();
self::_startSession();

if ((!self::id() && self::started()) || empty($_SESSION)) {
if (!$id && self::started()) {
self::_checkValid();
}

Expand Down Expand Up @@ -571,6 +570,8 @@ protected static function _configureSession() {
array($class, 'gc')
);
}
Configure::write('Session', $sessionConfig);
self::$sessionTime = self::$time + ($sessionConfig['timeout'] * 60);
}

/**
Expand Down

0 comments on commit 81f6f43

Please sign in to comment.