From the code generated by the yiic, as we know, using these code can only get id and username from Yii::app()->user after logined:
but how about adding some additional data to the user session? Here is the example.
1. implement the method "getPersistentStates()" in UserIdentify, for example:
public function getPersistentStates()
'roleId' => $this->_user->role_id,
then, you can get the data via Yii::app()->user->roleId after logined.
2. add the data wherever you want, just use these code:
then, you can get the data via Yii::app()->user->mykey.
Have fun with Yii!