Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

authTimeout in Yii2

Tags:

yii2

yii2-user

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

'user' => [
            'identityClass' => 'app\models\User',
            'enableAutoLogin' => true,
            'authTimeout'=>100
        ],

inside components . I am using basic template. But it is not logging out automatically. Does this work in Yii2? I was following documentation from http://www.yiiframework.com/doc-2.0/yii-web-user.html

like image 424
user7282 Avatar asked May 06 '15 10:05

user7282


1 Answers

$authTimeout - public property.

The number of seconds in which the user will be logged out automatically if he remains inactive. If this property is not set, the user will be logged out after the current session expires (c.f. yii\web\Session::$timeout).

Note that this will not work if $enableAutoLogin is true.

like image 197
Andrei Putivet Avatar answered Oct 11 '22 20:10

Andrei Putivet