My problem is as follows: In general, Yii::app()->user and its various attributes work just fine for me. However, I am making an Ajax call to a controller while logged in, attempting to build a new User object with a user’s id. But Yii::app()->user is outputted as Guest, and Yii::app()->user->id is coming out as null. Therefore my user object is useless.
I’m not at all sure what kind of information you guys might need for debugging. Can someone set me on the right track or some clarifying questions?
I’ll have to try this solution out later today when I’m not at work. Is there somewhere I can read about Yii sessions to derive the code you suggested below? I hate using code blind, although I will try it out tonight regardless.
Somehow, the problem fixed itself. I booted up the site and had no more problems. I will definitely look into CHttpSession, although I am not yet sure what advantages it provides.