Skip to content

Commit

Permalink
Fixes #332.
Browse files Browse the repository at this point in the history
  • Loading branch information
predominant committed Mar 26, 2010
1 parent d95e482 commit 9740029
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions cake/libs/session.php
Expand Up @@ -120,9 +120,9 @@ class CakeSession extends Object {
* Session Started
*
* @var boolean
* @access public
* @access protected
*/
var $started = false;
var $_started = false;
/**
* Constructor.
*
Expand Down Expand Up @@ -174,15 +174,15 @@ function __construct($base = null, $start = true) {
* @access public
*/
function start() {
if ($this->started) {
if ($this->started()) {
return true;
}
if (function_exists('session_write_close')) {
session_write_close();
}
$this->__initSession();
$this->started = $this->__startSession();
return $this->started;
$this->_started = $this->__startSession();
return $this->started();
}
/**
* Determine if Session has been started.
Expand All @@ -191,7 +191,7 @@ function start() {
* @return boolean True if session has been started.
*/
function started() {
if (isset($_SESSION)) {
if (isset($_SESSION) && $this->_started) {

This comment has been minimized.

Copy link
@0x20h

0x20h Apr 5, 2011

Contributor

This forces multiple session_write_close() calls in my projects. I wonder why that was put in as it enforces session#start() for each new session component/view helper. Do you remember why you put that in ?

return true;
}
return false;
Expand Down Expand Up @@ -223,7 +223,7 @@ function id($id = null) {
$this->id = $id;
session_id($this->id);
}
if (isset($_SESSION)) {
if ($this->started()) {
return session_id();
} else {
return $this->id;
Expand Down

0 comments on commit 9740029

Please sign in to comment.