cakephp 2.0 how to update auth data?

后端 未结 7 1320
别那么骄傲
别那么骄傲 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:51

    I think that the simpler way to do this is:

    $user = $this->Auth->user();
    $user['attribute'] = $newValue;
    $this->Auth->setUser($user);
    
    0 讨论(0)
提交回复
热议问题