I would avoid writing directly to the Auth's session.

Again, this is generally how Authentication systems work. User
information used by the application is stored in memory (session in
this case). You could force a logout, but I think that you're users
will find this more annoying to be logged out when they change their
profile.

BTW, what 'critical' data could you possibly need in the User session?
If you're displaying stuff on the website, why don't you read the
user_id from Auth and then the rest of the data from the actual table,
if it's critical? If it's critical, read it yourself.

Also, the solutions above will only help you with a user editing their
own profile. This won't help with you scenario of changing user roles.
How is the application expected to log everyone off? You only
possibility is if you use database sessions, then I assume you'd be
able to clear those out in an afterSave() or something like that.

So here's my question to you, what happens when you change your
permissions?
You change the locks when someone is in the house, your change will
only take effect after they leave.

On Jul 14, 11:02 am, RichardAtHome <[EMAIL PROTECTED]> wrote:
> Back again...
>
> Added the following to the save block of my edit function:
>
> $this->Session->write("Auth", $this->data);
>
> ($this->data is provided by the User edit form)
>
> Which fixed the problem but with a minor issue (which I can live with
> for now).
>
> On Jul 14, 2:57 pm, RichardAtHome <[EMAIL PROTECTED]> wrote:
>
> > Thanks for the feedback everyone. I'll give it a try today and post
> > back my results :-)
>
> > On Jul 14, 1:33 pm, "Jonathan Snook" <[EMAIL PROTECTED]> wrote:
>
> > > >  Anyone know how to refresh the user record? Is it simply a case of
> > > >  setting the Auth Session User var?
>
> > > Looking at the Auth source, it populates the key 'Auth.' .
> > > $this->userModel, or Auth.User by default. You may want to try just
> > > doing $this->Auth->login() again from the edit page (be sure to pass
> > > it the username and (hashed?) password).
>
> > > -js
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to