mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Fix for Session Component to use CakeSession started() checks. Refs #332.
This commit is contained in:
parent
9740029e9e
commit
9f5949ab52
2 changed files with 6 additions and 14 deletions
|
@ -43,13 +43,6 @@ class SessionComponent extends CakeSession {
|
|||
* @access private
|
||||
*/
|
||||
var $__active = true;
|
||||
/**
|
||||
* Used to determine if Session has been started
|
||||
*
|
||||
* @var boolean
|
||||
* @access private
|
||||
*/
|
||||
var $__started = false;
|
||||
/**
|
||||
* Used to determine if request are from an Ajax request
|
||||
*
|
||||
|
@ -89,7 +82,7 @@ class SessionComponent extends CakeSession {
|
|||
* @access public
|
||||
*/
|
||||
function startup(&$controller) {
|
||||
if ($this->__started === false && $this->__active === true) {
|
||||
if ($this->started() === false && $this->__active === true) {
|
||||
$this->__start();
|
||||
}
|
||||
}
|
||||
|
@ -299,15 +292,14 @@ class SessionComponent extends CakeSession {
|
|||
* @access private
|
||||
*/
|
||||
function __start() {
|
||||
if ($this->__started === false) {
|
||||
if ($this->started() === false) {
|
||||
if (!$this->id() && parent::start()) {
|
||||
$this->__started = true;
|
||||
parent::_checkValid();
|
||||
} else {
|
||||
$this->__started = parent::start();
|
||||
parent::start();
|
||||
}
|
||||
}
|
||||
return $this->__started;
|
||||
return $this->started();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -108,13 +108,13 @@ class SessionComponentTest extends CakeTestCase {
|
|||
Configure::write('Session.start', false);
|
||||
$Session =& new SessionComponent();
|
||||
$this->assertFalse($Session->__active);
|
||||
$this->assertFalse($Session->__started);
|
||||
$this->assertFalse($Session->started());
|
||||
$Session->startup(new SessionTestController());
|
||||
|
||||
Configure::write('Session.start', true);
|
||||
$Session =& new SessionComponent();
|
||||
$this->assertTrue($Session->__active);
|
||||
$this->assertFalse($Session->__started);
|
||||
$this->assertFalse($Session->started());
|
||||
$Session->startup(new SessionTestController());
|
||||
$this->assertTrue(isset($_SESSION));
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue