S
S
Sergey2016-02-17 09:50:47
Yii
Sergey, 2016-02-17 09:50:47

Authorization flies in Yii2, what's the problem?

After each closing of the browser, I have to go through the authorization process again, why does my session crash?
I find the user by a certain key. In the User class, I implemented the IdentityInterface interface

$identity = User::findOne(['auth_id' => $auth_id]);
Yii::$app->user->login($identity, 2592000);

Setting the component in the config:
'user' => [
            'identityClass' => 'app\models\user\User',
            'enableAutoLogin' => true,
        ],

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Egor Mokeev, 2016-02-17
@zetamen

Check getAuthKey and validateAuthKey, are they working correctly?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question