Navigation Menu

Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

fix for zendframework/zf2#3458 #3461

Merged
merged 1 commit into from Jan 17, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion library/Zend/Session/SessionManager.php
Expand Up @@ -163,7 +163,7 @@ public function writeClose()
// object isImmutable.
$storage = $this->getStorage();
if (!$storage->isImmutable()) {
$_SESSION = (array) $storage;
$_SESSION = $storage->toArray();
session_write_close();
$storage->fromArray($_SESSION);
$storage->markImmutable();
Expand Down
12 changes: 12 additions & 0 deletions tests/ZendTest/Session/SessionManagerTest.php
Expand Up @@ -153,6 +153,18 @@ public function testStartDoesNothingWhenCalledAfterWriteCloseOperation()
$this->assertEquals($id1, $id2);
}

/**
* @runInSeparateProcess
*/
public function testStorageContentIsPreservedByWriteCloseOperation()
{
$this->manager->start();
$storage = $this->manager->getStorage();
$storage['foo'] = 'bar';
$this->manager->writeClose();
$this->assertTrue(isset($storage['foo']) && $storage['foo'] == 'bar');
}

/**
* @runInSeparateProcess
*/
Expand Down