Permalink
Browse files

Fixes issue where CakeSession::destroy() would fail to properly resta…

…rt the session. Tests added. Fixes #787
  • Loading branch information...
1 parent 4cd4355 commit 60ab9800e2d951e32ebe0d6226dda17bc9bad68c @markstory markstory committed Jul 3, 2010
Showing with 5 additions and 1 deletion.
  1. +1 −1 cake/libs/cake_session.php
  2. +4 −0 cake/tests/cases/libs/cake_session.test.php
@@ -227,7 +227,7 @@ function start() {
* @return boolean True if session has been started.
*/
function started() {
- if (isset($_SESSION) && session_id()) {
+ if (!empty($_SESSION) && session_id()) {
return true;
}
return false;
@@ -255,6 +255,10 @@ function testDestroy() {
$this->Session->destroy();
$this->assertFalse($this->Session->check('bulletProof'));
$this->assertNotEqual($id, $this->Session->id());
+
+ $this->Session->cookieLifeTime = 'test';
+ $this->Session->destroy();
+ $this->assertNotEqual('test', $this->Session->cookieLifeTime);
}
/**

0 comments on commit 60ab980

Please sign in to comment.