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
$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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With