Difference between #1 and #2 of
How to add more information to Yii::app()->user

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.
 
21 0
28 followers
Viewed: 183 752 times
Version: 1.1
Category: Tutorials
Written by: qiang
Last updated by: Yang He
Created on: Feb 9, 2009
Last updated: 5 years ago
Update Article

Revisions

View all history