Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
When getting the session's id, check if the session is not closed
This introduced a regression from #9246, with an incomplete fix ;
As the `started` flag on the NativeSessionStorage was not `true`
anymore when saving the session, the session id was always empty
when saving it, and thus when sending the `PHPSESSID` cookie
  • Loading branch information
Taluu committed Nov 27, 2013
1 parent 763c8aa commit 5b9a727
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Expand Up @@ -161,7 +161,7 @@ public function start()
*/
public function getId()
{
if (!$this->started) {
if (!$this->started && !$this->closed) {
return ''; // returning empty is consistent with session_id() behaviour
}

Expand Down
Expand Up @@ -62,8 +62,12 @@ public function testGetId()
{
$storage = $this->getStorage();
$this->assertEquals('', $storage->getId());

$storage->start();
$this->assertNotEquals('', $storage->getId());

$storage->save();
$this->assertNotEquals('', $storage->getId());
}

public function testRegenerate()
Expand Down

0 comments on commit 5b9a727

Please sign in to comment.