I've a problem, it might be a small one but I couldn't find the solution for this. Yii:app()->user->getId() or Yii:app()->user->id is not returning value. it just returning empty result. But I've set the id in my UserIdentity class.
You’ll need to override the id property, present in your UserIdentity by default. To do it you can declare a new property called $_id, then your get method will return $_id, instead of $id. Look at this:
<?php
private $_id;
public function getId(){
return $this->_id;
}
?>
In your authenticate method you’ll assign your $_id property to your id caught of the database.
// When user is validated.
$this->_id=$record->id;