Answer the question
In order to leave comments, you need to log in
Broken user->identity when moving code to production server?
Hi all.
Moved the code from the test server to bare production. executed php init, selected production. everything went without errors.
but when you open the site, it swears at the appeal to non-object. it turned out that the
\Yii::$app->user
identity is unattached (var_dump shows NULL). although \Yii::$app->user itself is.
I thought the problem was with namespaces and the User class was not simply tied up. I did the line above:,
User::findOne(1)->first_name
and everything is ok.
Where did \Yii::$app->user-> identity go ?
UPD guys, I e6lan forgot to include short open tag, hence all the jambs. issue resolved.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question