mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
Refs #332. Beginning fix for multiple session starts.
This commit is contained in:
parent
4f4d3f9ffe
commit
d95e482894
1 changed files with 27 additions and 15 deletions
|
@ -116,6 +116,13 @@ class CakeSession extends Object {
|
|||
* @access public
|
||||
*/
|
||||
var $id = null;
|
||||
/**
|
||||
* Session Started
|
||||
*
|
||||
* @var boolean
|
||||
* @access public
|
||||
*/
|
||||
var $started = false;
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
|
@ -163,16 +170,19 @@ class CakeSession extends Object {
|
|||
/**
|
||||
* Starts the Session.
|
||||
*
|
||||
* @param string $name Variable name to check for
|
||||
* @return boolean True if variable is there
|
||||
* @return boolean True if session was started
|
||||
* @access public
|
||||
*/
|
||||
function start() {
|
||||
if ($this->started) {
|
||||
return true;
|
||||
}
|
||||
if (function_exists('session_write_close')) {
|
||||
session_write_close();
|
||||
}
|
||||
$this->__initSession();
|
||||
return $this->__startSession();
|
||||
$this->started = $this->__startSession();
|
||||
return $this->started;
|
||||
}
|
||||
/**
|
||||
* Determine if Session has been started.
|
||||
|
@ -475,7 +485,8 @@ class CakeSession extends Object {
|
|||
ini_set('session.auto_start', 0);
|
||||
}
|
||||
}
|
||||
session_set_save_handler(array('CakeSession','__open'),
|
||||
session_set_save_handler(
|
||||
array('CakeSession','__open'),
|
||||
array('CakeSession', '__close'),
|
||||
array('CakeSession', '__read'),
|
||||
array('CakeSession', '__write'),
|
||||
|
@ -507,7 +518,8 @@ class CakeSession extends Object {
|
|||
ini_set('session.cookie_path', $this->path);
|
||||
}
|
||||
}
|
||||
session_set_save_handler(array('CakeSession','__open'),
|
||||
session_set_save_handler(
|
||||
array('CakeSession','__open'),
|
||||
array('CakeSession', '__close'),
|
||||
array('Cache', 'read'),
|
||||
array('Cache', 'write'),
|
||||
|
|
Loading…
Add table
Reference in a new issue