Yii2 - How to set dynamic authTimeout in User Identity?
问题 Here, I have extended User Identity of Yii2. This is my configuration. 'user' => [ 'identityClass' => app\models\UserMaster::class, 'enableAutoLogin' => false, 'loginUrl' => ['/auth/login'], 'authTimeout' => 86400 ], Here, I have defined authTimout statically. But, What I want to do is that I want to fetch timeout value from database and set it in authTimeout . Thanks. 回答1: You can use event to set authTimeout before request will be handled: 'as beforeRequest' => [ 'class' => function (Event