ZF-10471: Zend_Application_Resource_Session application.ini example is incorrect


The documentation at http://framework.zend.com/manual/en/… provides an example for the application.ini

The problem is that the resources.session.saveHandler.options.primary and resources.session.saveHandler.options.primaryAssignment parts of the config example specify array key names, but specifying those causes a session_start error. This is because in Zend_Db_Table_Abstract L:896 the named array key would be undefined since $this->_identity is an int... Technically L:895&&896 only need to be under the if statement at L:902

The worst part about this issue is that it causes a red herring of an error message (Uncaught exception 'Zend_Session_Exception' with message 'session has already been started by session.auto-start or session_start()') if you are using another component that will start up the session (Zend_Auth) later in the same request. This is because in Zend_Db_Table_Abstract L:896 the named array key creates a session start error and in Zend_Session::start() it throws the session start error, but if you don't have resources.frontController.throwExceptions = 1 enabled, the session start exception gets overwritten by the session already started exception.

The documentation can be fixed by changing the example to: ( the session save path folder was also changed to 'sessions' to match http://framework.zend.com/manual/en/… )

resources.session.save_path = APPLICATION_PATH "/../data/sessions" resources.session.use_only_cookies = true resources.session.remember_me_seconds = 864000 resources.session.saveHandler.class = "Zend_Session_SaveHandler_DbTable" resources.session.saveHandler.options.name = "session" resources.session.saveHandler.options.primary[] = "session_id" resources.session.saveHandler.options.primary[] = "save_path" resources.session.saveHandler.options.primary[] = "name" resources.session.saveHandler.options.primaryAssignment[] = "sessionId" resources.session.saveHandler.options.primaryAssignment[] = "sessionSavePath" resources.session.saveHandler.options.primaryAssignment[] = "sessionName" resources.session.saveHandler.options.modifiedColumn = "modified" resources.session.saveHandler.options.dataColumn = "session_data" resources.session.saveHandler.options.lifetimeColumn = "lifetime"


Fixed with r23177 see ZF-6868.