app()->user undefined on first run

Hi, I’ve started to get this error recently.

It seems that the user object didn’t make it to initialize on the first run. Then I just press refresh, and everything goes on fine as usual. Received few complaints from users of my website, with the same description (I don’t show them the error print-out but the occurance and solution seem to be the same).

Any suggestions? Might this have happened upon svn updating my framework version?

Very strange… can you post here the complete error with the call stack…

Seems to have been our error.

In main layout we called


Yii::app()->user->method;

This seems to have fixed the issue:




$user = Yii::app()->user; $user->method;