In your config/web.php :
In the $config array:
...
'user' => [ 'identityClass' => 'app\models\User', //'enableAutoLogin' => true, 'enableSession' => true, 'authTimeout' => 60, ],
...
Note that I commented on //enableAutoLogin , which prevents authTimeout from working authTimeout
source share