开发者

Zend_Session::start() in bootstrap

开发者 https://www.devze.com 2023-01-22 21:57 出处:网络
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-reso

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
}
0

精彩评论

暂无评论...
验证码 换一张
取 消