Pages

Sunday, August 18, 2013

Cakephp-Refresh Auth Session information after a database change of current user

In order to update current user logged in Auth Session after a database change in his information in Users Table use the following command

$userid=$this->Auth->user('id');

$this->Session->write('Auth',$this->User->read(null,$userid));

That's it and your auth session is updated..

This is usually done once a user updates his information....

No comments:

Post a Comment