mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 04:26:20 +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) {
|
if (($checkAgent === true || $checkAgent === null) && env('HTTP_USER_AGENT') != null) {
|
||||||
self::$_userAgent = md5(env('HTTP_USER_AGENT') . Configure::read('Security.salt'));
|
self::$_userAgent = md5(env('HTTP_USER_AGENT') . Configure::read('Security.salt'));
|
||||||
}
|
}
|
||||||
|
self::_setPath($base);
|
||||||
if ($start === true) {
|
self::_setHost(env('HTTP_HOST'));
|
||||||
self::_setPath($base);
|
|
||||||
self::_setHost(env('HTTP_HOST'));
|
|
||||||
}
|
|
||||||
if (isset($_SESSION) || $start === true) {
|
|
||||||
self::start();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -374,12 +368,12 @@ class CakeSession {
|
||||||
* @return mixed The value of the session variable
|
* @return mixed The value of the session variable
|
||||||
*/
|
*/
|
||||||
public static function read($name = null) {
|
public static function read($name = null) {
|
||||||
if (is_null($name)) {
|
|
||||||
return self::__returnSessionVars();
|
|
||||||
}
|
|
||||||
if (empty($name)) {
|
if (empty($name)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (is_null($name)) {
|
||||||
|
return self::__returnSessionVars();
|
||||||
|
}
|
||||||
$result = Set::classicExtract($_SESSION, $name);
|
$result = Set::classicExtract($_SESSION, $name);
|
||||||
|
|
||||||
if (!is_null($result)) {
|
if (!is_null($result)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue