C
C
ChernovGV2019-10-23 13:32:02
Yii
ChernovGV, 2019-10-23 13:32:02

Yii2: Why doesn't authorization work on production, although everything is ok on the local version with the same database?

I posted the site on the battlefield, with the same environment (docker) as on the local assembly, but I can’t log in for the life of me.
Looked at the logs - empty.
Investigating:
I tried to set a new password, it did not help.
I connected a remote combat database on the local - authorization works...
I tried to write data to $_SESSION, everything seems to be ok and written and saved... Let's
investigate further:

$result = Yii::$app->user->login(new Identity($user), $form->rememberMe ? 3600 * 24 * 30 : 0);

Returns true
Immediately I check that in Yii::$app->user->isGuest - there is false, i.e. everything seems to be ok.
But with a new request Yii::$app->user->isGuest = true, and again there is a redirect to the authorization form... Tell me
what could be wrong? What configs to watch?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
ChernovGV, 2019-10-23
@ChernovGV

It was all about configs:
'cookieDomain' => 'back.some.domain',

A
Andrey, 2019-10-23
@VladimirAndreev

where should the production session be stored - can he write there at all?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question