Store referer in session (if referer is different from actual action)
and redirect to it when login is successful.  Storing referer in
session is an idea of AD7six (http://bin.cakephp.org/view/316159681)
and it let you do some interesting tricks.

On Sun, Mar 23, 2008 at 7:20 PM, Dave J <[EMAIL PROTECTED]> wrote:
>
>  Hey Nick,
>
>  You're right about that. I guess you can tackle it either two ways.
>
>  1) Submit the form using AJAX, so if there's any errors, you get them
>  back without a page refresh. And on successful login, you could either
>  hide the login form and replace it with a 'logged-in' message. Or send
>  back a JS command to refresh the page, so the page would reflect the
>  new logged-in status
>
>  2) Or use the flash feature of the Session Component/Helper to return
>  any errors as soon as the page refreshes. (Just make sure you have
>  $session->flash() somewhere in your layout)
>
>
>
>
>
>  On Mar 23, 8:00 pm, Nick Timchenko <[EMAIL PROTECTED]> wrote:
>  > Yeah, I was trying it, but that way I lose any data according to
>  > validation/authentication errors. Is there any solution?
>  >
>  > Regards,
>  > Nick
>  >
>  > Dave J wrote:
>  > > How about in the action which processes the form data, you pick up the
>  > > referer URL  ($this->referer() )  and at the end - after the user
>  > > successfully authenticates - you just redirect to that URL....
>  > > basically leaving him on the same page.
>  >
>  > > Dave
>  >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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