when I update data in the User model, the Auth data is not updated.
How can I "refresh" the data which is returned by $this->Auth->user() when I am updating user model ?
and I don't want to use
$this->Auth->login($data);
after updating my user table
I tried the following line. Its works well form me After modify the user data i written the following line
$this->Session->write('Auth', $this->User->read(null, $this->Auth->User('id')));
Write the updated data to the Session eg:
$this->Session->write('Auth.User', $data);
Before CakePHP 2.x you can't do this in the model without break the framework design.
With CakePHP 2.x you can load the Session Component from models and update it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With