forked from yiisoft/yii2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
10218 - Fix for session regenerate id issue that occured after user l…
…ogged out yiisoft#10218
- Loading branch information
1 parent
2f4d5ff
commit ab25b8a
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace yiiunit\framework\web; | ||
|
||
use yii\web\Session; | ||
use yiiunit\TestCase; | ||
|
||
/** | ||
* @group web | ||
*/ | ||
class SessionTest extends TestCase | ||
{ | ||
/** | ||
* Test to prove that Session::destroy generates session with new identifier | ||
*/ | ||
public function testDestroySessionId() | ||
{ | ||
$session = new Session(); | ||
$session->open(); | ||
$oldSessionId = @session_id(); | ||
|
||
$this->assertNotEmpty($oldSessionId); | ||
|
||
$session->destroy(); | ||
|
||
$newSessionId = @session_id(); | ||
$this->assertNotEmpty($newSessionId); | ||
$this->assertEquals($oldSessionId, $newSessionId); | ||
} | ||
} |