Issues

ZF-11277: The private function _processStartupMetadataGlobal in zend_session.php cannot unset $_SESSION['__ZF'] thoroughly

Description


private static function _processStartupMetadataGlobal()
 {
 // process global metadata
 if (isset($_SESSION['__ZF'])) {

 // expire globally expired values
 foreach ($_SESSION['__ZF'] as $namespace => $namespace_metadata) {

 ........
 ........

 }

 if (isset($namespace) && empty($_SESSION['__ZF'][$namespace])) {
 unset($_SESSION['__ZF'][$namespace]);
 }
 }

 if (isset($_SESSION['__ZF']) && empty($_SESSION['__ZF'])) {
 unset($_SESSION['__ZF']);
 }
 }

If there are two namspaces to store my data, and both of them should be expire at this time, the codes above shows that only the last namespace can be unset, and the previous one cannot.

Comments

I've moved the block of code in question:


if (isset($namespace) && empty($_SESSION['__ZF'][$namespace])) {
    unset($_SESSION['__ZF'][$namespace]);
}

inside the foreach loop where it belongs.

Fixed in trunk r23891

Hello, Adam. I will push [solve] button as proxy for You. If You want to release at next mini, You can merge this commit fron trunk to 1.11 branch.

Thanks.

Not merged yet, will merge shortly.

Fixed in release branch 1.11 in r23955