A
A
Artyom2015-06-01 11:45:04
Yii
Artyom, 2015-06-01 11:45:04

Yii2: why is authentication failing?

Tell me what's the problem. Authorization works, but after refreshing the page, it is no longer authorized.

if ($this->validate()) {
       return Yii::$app->user->login($this->getUser(), 3600*24*30);
} else {
       return false;
}

Returns true, but when the page is refreshed there is no authorization.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
matperez, 2015-06-01
@matperez

Check that \Yii::$app->user->enableSession = true;

A
Artyom, 2015-06-01
@DeOne

Are there other possible problems? Maybe it's because I use password verification not using Yii, but my own encryption?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question