Skip to content

Commit

Permalink
Removing auto-start from CakeSession. Lazy starting will be more perf…
Browse files Browse the repository at this point in the history
…ormant in most cases.
  • Loading branch information
markstory committed Dec 14, 2010
1 parent 2fe6014 commit 9e1c85e
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions cake/libs/cake_session.php
Expand Up @@ -151,14 +151,8 @@ public static function init($base = null, $start = true) {
if (($checkAgent === true || $checkAgent === null) && env('HTTP_USER_AGENT') != null) {
self::$_userAgent = md5(env('HTTP_USER_AGENT') . Configure::read('Security.salt'));
}

if ($start === true) {
self::_setPath($base);
self::_setHost(env('HTTP_HOST'));
}
if (isset($_SESSION) || $start === true) {
self::start();
}
self::_setPath($base);
self::_setHost(env('HTTP_HOST'));
}

/**
Expand Down Expand Up @@ -374,12 +368,12 @@ public static function userAgent($userAgent = null) {
* @return mixed The value of the session variable
*/
public static function read($name = null) {
if (is_null($name)) {
return self::__returnSessionVars();
}
if (empty($name)) {
return false;
}
if (is_null($name)) {
return self::__returnSessionVars();
}
$result = Set::classicExtract($_SESSION, $name);

if (!is_null($result)) {
Expand Down

0 comments on commit 9e1c85e

Please sign in to comment.