Permalink
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...
1 parent aad7287 commit d5bde3fe7a5a66044d4778ccffed0254e2fc87d8 @markstory markstory committed Sep 9, 2010
Showing with 5 additions and 1 deletion.
  1. +3 −0 cake/libs/cake_session.php
  2. +2 −1 cake/tests/cases/libs/cake_session.test.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();
@@ -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);

0 comments on commit d5bde3f

Please sign in to comment.