Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding a call to session_destroy() to remove the session data. This f…

…ixes the issue where data would not be totally destroyed. Fixes #1089
  • Loading branch information...
commit d5bde3fe7a5a66044d4778ccffed0254e2fc87d8 1 parent aad7287
@markstory markstory authored
View
3  cake/libs/cake_session.php
@@ -454,6 +454,9 @@ function write($name, $value) {
* @access public
*/
function destroy() {
+ if ($this->started()) {
+ session_destroy();
+ }
$_SESSION = null;
$this->__construct($this->path);
$this->start();
View
3  cake/tests/cases/libs/cake_session.test.php
@@ -255,7 +255,8 @@ function testDestroy() {
$this->Session->destroy();
$this->assertFalse($this->Session->check('bulletProof'));
$this->assertNotEqual($id, $this->Session->id());
-
+ $this->assertTrue($this->Session->started());
+
$this->Session->cookieLifeTime = 'test';
$this->Session->destroy();
$this->assertNotEqual('test', $this->Session->cookieLifeTime);
Please sign in to comment.
Something went wrong with that request. Please try again.