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

Mike Tonks fluffymike at googlemail.com
Tue Dec 2 10:53:15 EST 2008


How about a javascript timer to take them back to the login form when they
time out, avoiding the problem of them filling in the form with an expired
session?

Otherwise, CGI can be initialised from a hashref, which should save you
needing to use anything as drastic as LWP.

    $query = new CGI( {'dinosaur'=>'barney',
                       'song'=>'I love you',
                       'friends'=>[qw/Jessica George Nancy/]}
                    );


http://search.cpan.org/~lds/CGI.pm-3.42/CGI.pm#CREATING_A_NEW_QUERY_OBJECT_FROM_AN_INPUT_FILE

mike

2008/12/2 Clayton Scott <clayton.scott at gmail.com>

> On Tue, Dec 2, 2008 at 10:28 AM, Michael Peters <mpeters at plusthree.com
> >wrote:
>
> > 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.
> >
>
>
> Thanks for the confirmation that I wasn't totally barking up the wrong
> tree.
> I'll run with those two ideas and see where I get.
>
>
> Clayton
> --
>
> Clayton Scott
> clayton.scott at gmail.com
>
> #####  CGI::Application community mailing list  ################
> ##                                                            ##
> ##  To unsubscribe, or change your message delivery options,  ##
> ##  visit:  http://lists.openlib.org/mailman/listinfo/cgiapp    ##
> ##                                                            ##
> ##  Web archive:   http://lists.openlib.org/pipermail/cgiapp/   ##
> ##  Wiki:          http://cgiapp.erlbaum.net/                 ##
> ##                                                            ##
> ################################################################
>
>


More information about the cgiapp mailing list