[cgiapp] How do I implement this pattern: Resume interrupted POST after login

Michael Peters mpeters at plusthree.com
Tue Dec 2 10:28:55 EST 2008


Clayton Scott wrote:

> I went as far as freezing the query and stuffing it into the session. Short
> of using LWP
> to rerun the POST what are my options?

That's actually a pretty good option. You can't just pass the extra POST params to the 
authentication request since they might mess it up (think of having a "New User" form where you fill 
out a new user's username, then that get's passed to the authentication program and fails...) also 
since you're using some other 3rd party for authentication there's no guarantee that they'll pass 
those extra params back to you.

So you need to serialize and store the params (you could use Storable and a session for this) and 
then when redirected back check if there's something stored to replay, and if there is then do it. 
You don't necessarily need to use LWP. If you're using mod_perl you could do a subrequest, or if 
just plain C::A you could figure out what module you're going to run and just call it's run() 
directly after setting up a CGI.pm object with your thawed POST params.

-- 
Michael Peters
Plus Three, LP



More information about the cgiapp mailing list