I wonder this isn’t a more frequently asked issue, but maybe I just use the wrong keywords and didn’t find the solution because of that. Anyway, here is my issue:
- I list a bunch of objects on my page together with a form and a “book now” button.
- Whenever someone want’s to book, the ID of the object will be passed together with the form to the controller action “a”
- Controller action “a” however, requires authentication for which I use the cake authentication component (very easy setup, it only checks if a user is logged in and in case he isn’t, he will be forwarded to the login page)
- Issue: Once a user has logged in, the request data as well as the session data is plain empty though, hence the object he wants to book can’t be identified in the follow up action anymore, it is completely lost.
Question: What is best practice to NOT LOSE form data when authenticating a user?
EDIT: I use form authentication and session as storage.