mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
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:
parent
aad72871a0
commit
d5bde3fe7a
2 changed files with 5 additions and 1 deletions
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue