From 83651091cef8a677844dbb6d2d318677eaaead45 Mon Sep 17 00:00:00 2001 From: predominant Date: Thu, 24 Jun 2010 10:30:12 +1000 Subject: [PATCH] Refactor session timeouts. --- cake/libs/cake_session.php | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/cake/libs/cake_session.php b/cake/libs/cake_session.php index ddefa4506..5c478d3ed 100644 --- a/cake/libs/cake_session.php +++ b/cake/libs/cake_session.php @@ -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':