Skip to content

Commit 0db7ec3

Browse files
committed
Made session's request countdown configurable by setting Session.requestCountdown config variable.
Removed unused Session class properties. Closes #2078
1 parent a5bf71c commit 0db7ec3

File tree

1 file changed

+10
-19
lines changed

1 file changed

+10
-19
lines changed

Cake/Network/Session.php

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,6 @@ class Session {
7878
*/
7979
public static $time = false;
8080

81-
/**
82-
* Cookie lifetime
83-
*
84-
* @var integer
85-
*/
86-
public static $cookieLifeTime;
87-
8881
/**
8982
* Time when this session becomes invalid.
9083
*
@@ -106,21 +99,14 @@ class Session {
10699
*/
107100
public static $host = null;
108101

109-
/**
110-
* Session timeout multiplier factor
111-
*
112-
* @var integer
113-
*/
114-
public static $timeout = null;
115-
116102
/**
117103
* Number of requests that can occur during a session time without the session being renewed.
118104
* This feature is only used when config value `Session.autoRegenerate` is set to true.
119105
*
120106
* @var integer
121107
* @see Cake\Network\Session::_checkValid()
122108
*/
123-
public static $requestCountdown = 10;
109+
protected static $_requestCountdown = 10;
124110

125111
/**
126112
* Pseudo constructor.
@@ -629,9 +615,14 @@ protected static function _checkValid() {
629615
static::$valid = false;
630616
return false;
631617
}
632-
if ($config = static::read('Config')) {
633-
$sessionConfig = Configure::read('Session');
634618

619+
$sessionConfig = Configure::read('Session');
620+
$requestCountdown = static::$_requestCountdown;
621+
if (isset($sessionConfig['requestCountdown'])) {
622+
$requestCountdown = $sessionConfig['requestCountdown'];
623+
}
624+
625+
if ($config = static::read('Config')) {
635626
if (static::_validAgentAndTime()) {
636627
static::write('Config.time', static::$sessionTime);
637628
if (isset($sessionConfig['autoRegenerate']) && $sessionConfig['autoRegenerate'] === true) {
@@ -641,7 +632,7 @@ protected static function _checkValid() {
641632

642633
if ($check < 1) {
643634
static::renew();
644-
static::write('Config.countdown', static::$requestCountdown);
635+
static::write('Config.countdown', $requestCountdown);
645636
}
646637
}
647638
static::$valid = true;
@@ -653,7 +644,7 @@ protected static function _checkValid() {
653644
} else {
654645
static::write('Config.userAgent', static::$_userAgent);
655646
static::write('Config.time', static::$sessionTime);
656-
static::write('Config.countdown', static::$requestCountdown);
647+
static::write('Config.countdown', $requestCountdown);
657648
static::$valid = true;
658649
}
659650
}

0 commit comments

Comments
 (0)