Cakephp

How to reset the User data in session when changes are made


How to reset the User data in session when changes are made

When a user's profile is updated, you want to reset the user details which are set when registering/login by the auth component

 

you do it like so:

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

or try

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

Published: 1st June 2016 by

Adverts