mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Refactor session timeouts.
This commit is contained in:
parent
9bbaf153f7
commit
83651091ce
1 changed files with 3 additions and 19 deletions
|
@ -460,29 +460,13 @@ class CakeSession extends Object {
|
|||
*/
|
||||
function __initSession() {
|
||||
$iniSet = function_exists('ini_set');
|
||||
|
||||
if ($iniSet && env('HTTPS')) {
|
||||
ini_set('session.cookie_secure', 1);
|
||||
}
|
||||
|
||||
switch ($this->security) {
|
||||
case 'high':
|
||||
$this->cookieLifeTime = Configure::read('Session.timeout') * Security::inactiveMins();
|
||||
if ($iniSet) {
|
||||
ini_set('session.referer_check', $this->host);
|
||||
}
|
||||
break;
|
||||
case 'medium':
|
||||
$this->cookieLifeTime = Configure::read('Session.timeout') * Security::inactiveMins();
|
||||
if ($iniSet) {
|
||||
ini_set('session.referer_check', $this->host);
|
||||
}
|
||||
break;
|
||||
case 'low':
|
||||
default:
|
||||
$this->cookieLifeTime = Configure::read('Session.timeout') * Security::inactiveMins();
|
||||
break;
|
||||
if ($iniSet && ($this->security === 'high' || $this->security === 'medium')) {
|
||||
ini_set('session.referer_check', $this->host);
|
||||
}
|
||||
$this->cookieLifeTime = Configure::read('Session.timeout') * Security::inactiveMins();
|
||||
|
||||
switch (Configure::read('Session.save')) {
|
||||
case 'cake':
|
||||
|
|
Loading…
Reference in a new issue