Simple example.
We have simple login\auth
methods (so i won't show them). On ajax request we change some user values (in db) in resoponce we call Yii::app()->user->someMethod()
and we will not get latest data (i mean from db). I understand why, because user init()
on start Yii so data will be old through all code until refresh. On refresh user init()
again and we see actual data.
Question is, how to refresh user like simple model User::model()->refresh()
to get actual data from db?