Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Catalyst Redirect Hints?

by saberworks (Curate)
on Mar 25, 2009 at 21:32 UTC ( [id://753263]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://753263]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-25 15:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found