Skip to content
Permalink
Browse files

Refactor session timeouts.

  • Loading branch information...
predominant committed Jun 24, 2010
1 parent 9bbaf15 commit 83651091cef8a677844dbb6d2d318677eaaead45
Showing with 3 additions and 19 deletions.
  1. +3 −19 cake/libs/cake_session.php
@@ -460,29 +460,13 @@ function destroy() {
*/
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':

0 comments on commit 8365109

Please sign in to comment.
You can’t perform that action at this time.