ZF-10471: Zend_Application_Resource_Session application.ini example is incorrect

Issue Type: Docs: Problem Created: 2010-09-18T14:06:24.000+0000 Last Updated: 2010-10-20T16:18:42.000+0000 Status: Resolved Fix version(s): - 1.11.0 (02/Nov/10)

Reporter: Christopher Manning (manningc) Assignee: Ramon Henrique Ornelas (ramon) Tags: - Zend_Application_Resource

Related issues: - ZF-6868



The documentation at… 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 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… )

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" = "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"


Posted by Ramon Henrique Ornelas (ramon) on 2010-10-20T16:17:11.000+0000

Fixed with r23177 see ZF-6868.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.