Like when giving a permission (role) to a user, and then taking it
back from him.
I'll try looking into db sessions, thanks.

On May 21, 12:38 pm, AD7six <andydawso...@gmail.com> wrote:
> On Monday, 21 May 2012 08:55:25 UTC+2, rahajiyev wrote:
>
> > Is there a way to tell Cake not to cache Auth info in the session?
> > Whenever the admin changes a users data (like the time when password
> > will expire) he needs to mirror that change in the Session so the user
> > Auth can pick up the changes and act accordingly:
>
> >   public function beforeSave() {
> >                 $data = &$this->data[$this->alias];
> >                 if (isset($data['new_password'])) {
> >                         $data['password'] =
> > AuthComponent::password($data['new_password']);
> >                         $data['password_expiration'] = date('Y-m-d
> > H:i:s', strtotime("+1 month"));
>
> > SessionComponent::write('Auth.User.password_expiration',
> > $data['password_expiration']);
> >                 }
> > }
>
> > Without the last line, the stale data in Session would be used. This
> > isn't cool at all.
>
> Why would an admin change anything related to a logged-in-user's data? That
> doesn't sound very sensible - which mainstream sites do you think do that?
>
> If you want to do what you're asking - you need to update where the data is
> stored, which by default is a file (look at your php config). It's a little
> easier if you use db sessions, but generally speaking what you're asking is
> quite unconventional.
>
> AD

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to