http://qs321.pair.com?node_id=753263


in reply to Catalyst Redirect Hints?

I think this may be a problem if the forms are being POSTed. As far as I know, you can't do a POST redirect, only a GET. If you're only concerned about GET, the way I've seen it done before is that all the parameters are forwarded along to the login page (usually in a session or in hidden parameters), then forwarded again to the "process" login page, and then that page redirects you back to the form submission with the parameters tacked onto the end of the URL. I don't think this is possible with POST though.

Update: I should have said, I don't think it's possible with perl. There are a number of hacky solutions out there that I pulled up in a google search. A perl book suggests converting all posted parameters to get parameters and then redirecting as a GET. That will lose any file uploads and will break forms if their processing programs are specifically looking for POST requests. Another option would be to redirect them to the form itself and prefill it so they can continue where they were. This will again lose all file upload fields and passwords because browsers don't fill those in if you set their values in the HTML. I read one other solution that recommended rebuilding the form using javascript (hidden) and then using a client-side submit() method to submit the form.