mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 00:48:25 +00:00
Removing auto-start from CakeSession. Lazy starting will be more performant in most cases.
This commit is contained in:
parent
2fe60142f5
commit
9e1c85e627
1 changed files with 5 additions and 11 deletions
|
@ -151,14 +151,8 @@ class CakeSession {
|
|||
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'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -374,12 +368,12 @@ class CakeSession {
|
|||
* @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)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue