Zend_Session::start() in bootstrap
can you tell me how to include the Zend_Sess开发者_开发问答ion::start() in a bootstrap file of zf app?
Use the application resource - http://framework.zend.com/manual/en/zend.application.available-resources.html#zend.application.available-resources.session
All you need to do is provide a "session" section in your config file "resources" section.
At a minimum, I'd recommend setting a session name, eg
resources.session.name = "MyAppName"
or if using Zend_Config_Xml
<resources>
<session>
<name>MyAppName</name>
</session>
</resources>
If you want to do some session stuff in your Bootstrap class, just make sure you bootstrap the session resource first to pick up your configuration options, eg
protected function _initSessionNamespaces()
{
$this->bootstrap('session');
// now create your namespace(s) and whatnot
}
精彩评论