Yii:app()->user is missing

When I give a value to Yii::app()->user->name and Yii::app()->user->id , then jump to another page. I find the Yii::app()->user->name turns out to be Guest and the id is set to be null (using IE), but it works well in chrome and Firefox. What’s the matter? Can anyone help me solve this problem? Thanks!

you should declare it on cwebuser, read this, and then set it up in the user component

There shouldn’t be difference in this behavior among browser.

There are only a few options:

  1. You are logged in using Chrome but not using IE

  2. IE has the cookies blocked.

Thank u ! I found it’s a fault about IE settings. When I change settings in “privacy” tab, it works well now. Maybe I have to find another way to solve this problem.

No, there are no issues.

If the browser doesn’t send the cookie, we cannot remember the vistor, that’s it.