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!
In reply to CGI::Application redirect loses cookie by bradcathey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |