I am using below code to auto logout after some time interval
'session' => [
'timeout' => 10,
],
'user' => [
'identityClass' => 'common\models\User',
'enableAutoLogin' => false,
'authTimeout' => 10,
],
It logged out successfully but did not redirect to login page how to do that?
You can use behaviors for actions.
So user is not logged in it will redirect to login url. You can also set login url
OR You can use beforeAction method to check that user is logged in or not and send user to login page.