YII 2在自动注销后获得用户身份

时间:2016-12-12 05:23:47

标签: php session yii2

在Yii 2中,我必须存储用户的登录信息并在一个表中注销。现在,当用户登录并手动注销时,我在表中存储了登录和注销数据(datetime)。

但是当任何用户在会话自动过期时自动注销,那时我没有获得用户身份,这就是我没有收到注销数据的原因(datetime)。

我的自动会话过期时间是1小时。

'user' => [
    'identityClass'       => 'common\models\Users',
    'enableAutoLogin'     => true,
    'idParam'             => '_frontend',
    'identityCookie'      => ['name' => '_identity-frontend', 'httpOnly' => true],            
    'class'               => 'nill\forum\PhpBBWebUser',
    'authTimeout'         => 3600,
    //'absoluteAuthTimeout' => 3600,
],
'session' => [
    // this is the name of the session cookie used for login on the frontend
    'name' => 'advanced-frontend',            
],

我想在用户自动注销或会话过期后获得用户身份。

0 个答案:

没有答案
相关问题