Session data is empty in Session SaveHandler's write function #3458

JaepilCyan opened this Issue Jan 17, 2013 · 3 comments


None yet
5 participants

JaepilCyan commented Jan 17, 2013

While running Zend\Session\SaveHandler\MongoDB on php5.4, noticed the $data parameter in 'write' function was always empty.

After an investigation, found the following array cast always returned an empty array rather than calling $storage's toArray() function.

// Line 167, Zend\Session\SessionManager.php, in writeClose() function
$_SESSION = (array) $storage;

Not sure if this is the right solution, but this seems to fix it

// Hotfix
$_SESSION = (array) $storage->toArray();

Maks3w commented Jan 17, 2013

Good, send us a PR with the patch.

Also the array cast is not longer necessary


netiul commented Jan 17, 2013

@Maks3w PR created


davidwindell commented Jan 17, 2013

I can confirm this fixes the issue I raised in #3450

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment