Adding a call to session_destroy() to remove the session data. This fixes the issue where data would not be totally destroyed. Fixes #1089

This commit is contained in:
mark_story 2010-09-08 22:05:53 -04:00
parent aad72871a0
commit d5bde3fe7a
2 changed files with 5 additions and 1 deletions

View file

@ -454,6 +454,9 @@ class CakeSession extends Object {
* @access public
*/
function destroy() {
if ($this->started()) {
session_destroy();
}
$_SESSION = null;
$this->__construct($this->path);
$this->start();

View file

@ -255,7 +255,8 @@ class CakeSessionTest extends CakeTestCase {
$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);