Revision #2 has been created by qiang on Feb 9, 2009, 1:25:11 PM with the memo:
Added security note
« previous (#1) next (#3) »
Changes
Title
unchanged
How to add more information to Yii::app()->user
Category
unchanged
Tutorials
Yii version
unchanged
Tags
unchanged
Content
changed
[...]
$id=Yii::app()->user->id;
$lastLoginTime=Yii::app()->user->getState('lastLoginTime');
// starting from 1.0.3 you can use the following:
// $lastLoginTime=Yii::app()->user->lastLoginTime;
```
> Note: When cookie-based authentication is enabled (by setting [CWebUser::allowAutoLogin] to be true), these persistent information will be stored in cookie. Therefore, you should NOT store sensitive information (e.g. password) like we do in the above.