ZF-11521: Zend_Session::start() fails with MYSQLI and Zend_Session_SaveHandler_DbTable

Description

It works fine with 5.2.14, but php 5.2.6 and 5.2.13, and ZF 1.11.6 (though users in our forums reported a variety of php version) an exception is thrown in session_start().

I narrowed the problem down to this line in _setupMetadata() in Db/Table/Abstract.php:


        if ($this->metadataCacheInClass() && (count($this->_metadata) > 0)) {

A var_dump() of _metadata shows UNKNOWN:0. That looks like an internal PHP bug.

Workaround/Patch: (CLA already on file)


Index: Db/Table/Abstract.php
===================================================================
--- Db/Table/Abstract.php   (revision 4945)
+++ Db/Table/Abstract.php   (working copy)
@@ -267,6 +267,8 @@
 
         $this->_setup();
         $this->init();
+
+   $this->_metadata = array();
     }
 
     /**

Comments

I tried to reproduce this with php 5.2.17 and 5.3.6, even with eaccelerator turned on. This wasn't possible. The session is stored in the database, it 'just works'. It indeed seems to be a php problem, possibly even related to something specific you tried to store in the session. I used ZF 1.11.11 latest from svn.

If you provide more information about a specific setup and full sample code that triggers the exception, I could look into this a little further, but I think it would be best to just avoid php versions or versions of eaccelerator that cause this problem.