How to add more information to Yii::app()->user

Comparing #3 with #4

Revision #4 was created by atrandafir atrandafir on Jan 10, 2010, 12:18:03 PM.

Adding link to another method

Content

[...]
// If you are using version 1.0.2 or earlier, you should use the following:
// $lastLoginTime=Yii::app()->user->getState('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.

 
**Related article**  
 
The method explained above stores the user data into session or cookies when the user authenticates, there is another method of retrieveing user information from database directly:  
 
[Add information to Yii::app()->user by extending CWebUser](http://www.yiiframework.com/doc/cookbook/60/)