C
C
cu7kh2019-02-13 16:55:11
Yii
cu7kh, 2019-02-13 16:55:11

Why is the user not logged out Yii2?

Set the 'user' component in the configuration

...
'user' => [
            'identityClass' => 'app\models\auth\User',
            'enableAutoLogin' => true,
            'loginUrl' => '/login',
            'autoRenewCookie' => false,

        ]
...

When authorizing, I additionally specify the duration of the cookie for a day After the expiration of the day, or if the cookie is manually deleted, the user still remains authorized in the system. How to make it so that authorization is checked only for cookies?
Yii::$app->user->login($user, 3600*24);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2019-02-13
@webinar

'identityClass' => 'app\models\auth\User',

this is a custom class, how do we know what is in it?
huh what is this. Only you and the author of your 'app\models\auth\User' know
Authorization in the session, cookie - needed to store the session id. So the lifetime must be specified for the session

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question