cakephp 2.0 how to update auth data?

后端 未结 7 1340
别那么骄傲
别那么骄傲 2021-02-01 08:12

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

7条回答
  •  旧巷少年郎
    2021-02-01 08:25

    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.

提交回复
热议问题