开发者

Zend_Session::start overwites application.ini settings

开发者 https://www.devze.com 2023-02-19 14:40 出处:网络
If I use Zend_Session::start() in my bootstrap, it overwrites any resource.session settings I have made in my ap开发者_如何学Goplication.ini.Is this expected behaviour?Does that mean that all Zend res

If I use Zend_Session::start() in my bootstrap, it overwrites any resource.session settings I have made in my ap开发者_如何学Goplication.ini. Is this expected behaviour? Does that mean that all Zend resources should be configured either a) in the bootstrap, or b) in the application.ini, but not in both?


You don't need to explicitly start the session, it will happen automatically on first use.

If you must start the session yourself, make sure you bootstrap the session resource first, eg

protected function _initSessionstart()
{
    $this->bootstrap('session');
    Zend_Session::start();
}

Another consideration... if you name your bootstrap method _initSession(), this will be run instead of the resource plugin of the same name. This is by design so you can write custom bootstrap overrides.

0

精彩评论

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

关注公众号