authTimeout in Yii2

后端 未结 6 818
余生分开走
余生分开走 2021-01-12 17:22

I am trying to log out user automatically in yii2 after he is idle for a fixed seconds . In web.php I added

\'user\' => [
             


        
6条回答
  •  清酒与你
    2021-01-12 18:10

    In your config/web.php file:

    In $config array:

    ...

    'user' => [
                'identityClass' => 'app\models\User',
                //'enableAutoLogin' => true,
                'enableSession' => true,
                'authTimeout' => 60,
            ],
    

    ...

    Please note I commented the //enableAutoLogin, that prevents of authTimeout to work properly

提交回复
热议问题