On Mar 19, 3:04 pm, "Andre" <[EMAIL PROTECTED]> wrote: > So, since I'm trying to build a blog application, this could be a > problem, because if a session expires while I'm still writing my > article, as soon as I press the submit button all of my work becomes > dust.
Andre, I got through this a while back by using this neat trick. I don't know how you have your authentication setup, but here's the concept, and you can work it into your code. Basically, you want to capture whatever is stored in $this->data (aka, $_POST) and keep it around until you login again. That way, you can safely enter whatever you want into any form, take as long as you want, and safely submit your form. This trick will take you to your login page, and then redirect you to the page you were trying to go to, but this time, submit all your form data. When you check to see if the current user is logged in, and then you find out they're not, store both the destination ($this->here) and the post data ($this->data) in two session variables. Then redirect to the login page. Now, after you log back in, redirect to the original destination, and when that page loads, check to see if there is any post data stored in the session. If so, assign $this->data the post data, and you'll be all set. It might take some working through to make it work right, but I got it to work, and all of that in my app_controller and a little bit of beforeFilter() magic. Good luck! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
