bradcathey has asked for the wisdom of the Perl Monks concerning the following question:
Fellow Monasterians:
Using CGI::Application::Plugin::Session and CGI::Application::Plugin::Redirect I was struggling with a session cookie being rewritten and losing values between trips to the server. Finally another coder pointed me to this piece that states:
Redirection—or any other non standard (200 OK) output page HTTP result —does not allow additional HTTP headers to be added to the request, which effectively means you cannot Redirect and send a cookie on the same request. Instead you have to create an intermediate page contains redirect link in a META tag, or a phyical HREF link the user clicks on to go to the next page. HTML pages and browsers support the META Refresh tag which makes this possible."
Seems kludgy at best, so I was wondering if there is another way to get around this? Here's the scenario:
Submission of | [login.tmpl] form | fires instance script | [login.cgi] | that calls | [Login.pm] | which authenticates user and assigns the user's id to | $self->session->param('user_id' => $user_id) | and then | $self->redirects('admin.cgi'), an instance script which fires | [Admin.pm] | which tries to retrieve | $self->session->param('user_id') | which is undef'ed
So, is there a way to avoid the HTML metatag redirect method and keep it Perlish? Thanks!
—Brad
"The important work of moving the world forward does not wait to be done by perfect men." George Eliot
"The important work of moving the world forward does not wait to be done by perfect men." George Eliot
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: CGI::Application redirect loses cookie
by Your Mother (Archbishop) on Jan 06, 2009 at 04:32 UTC | |
Re: CGI::Application redirect loses cookie
by rhesa (Vicar) on Jan 06, 2009 at 04:41 UTC | |
Re: CGI::Application redirect loses cookie
by ww (Archbishop) on Jan 06, 2009 at 02:49 UTC | |
by bradcathey (Prior) on Jan 06, 2009 at 02:56 UTC | |
by Arunbear (Prior) on Jan 06, 2009 at 08:04 UTC | |
by jaldhar (Vicar) on Jan 08, 2009 at 03:13 UTC | |
Re: CGI::Application redirect loses cookie
by karavelov (Monk) on Jan 06, 2009 at 11:18 UTC |
Back to
Seekers of Perl Wisdom