Yii users being logged out after 15-30 minutes despite session timeouts being set to at least 1 day

后端 未结 5 1763
南笙
南笙 2020-12-08 20:41

I\'ve included the relevent parts of our Yii config file below:

return array(
...
    \'components\'=>array(
        \'session\' => array(
                     


        
5条回答
  •  [愿得一人]
    2020-12-08 21:13

    http://www.yiiframework.com/doc/api/1.1/CWebUser#login-detail

    Thanks to help from Arfeen who pointed me in the right direction, unless you set the second parameter of Yii::app()->user->login() it turns out that Yii will not use a persistent cookie, as the second parameter defaults to 0. This default 0-value overrides anything else you might have set to do with timeouts.

提交回复
热议问题