[cgiapp] CGI::Application::FastCGI -> The page isn't redirecting properly???

CGI User cgiapp at mailswamp.com
Fri May 23 11:27:53 EDT 2008


Hi Todd,

In my application session ID has four sources. It is embedded in the template 
$tmpl_sess_id, stored in database $sess_sess_id, derived from URL string as 
$url_sess_id and available via $self->param() function as $sess_id;

This partial piece of code which brought your attention does not represent the 
complete code for the whole session validation algorithm.
I'm sorry for your confusion, but the whole thing works OK if I use 
CGI::Application module, and it doesn't if I use CGI::Application::FastCGI.
That was the primary reason for my initial posting.

Alex


Todd Ross wrote:
> Probably unrelated, I'm not really familiar with FastCGI, but this doesn't look right to me:
> 
>      my $sess_id = $self->param('sess_id'); // removed extra paren as others pointed out
> 
>      if (!$url_sess_id) {
>          $self->delete_old_sess($sess_sess_id) if $sess_sess_id;
> 
> What is $sess_sess_id?  Are you using strict and warnings?
> 
> What does Firebug, Live HTTP Headers, and/or Tamper Data show as the response (include headers) for the redirect?
> 
> Todd
> 
> 
> ----- Original Message ----
> From: CGI User <cgiapp at mailswamp.com>
> To: CGI Application <cgiapp at lists.openlib.org>
> Sent: Thursday, May 22, 2008 7:00:22 PM
> Subject: [cgiapp] CGI::Application::FastCGI -> The page isn't redirecting properly???
> 
> Hello,
> 
> I encounter very strange problem using CGI::Application::FastCGI module.
> Firefox browser displays this warning:
> "The page isn't redirecting properly
> Firefox has detected that the server is redirecting the request for this address 
> in a way that will never complete."
> when I try to redirect to another page using CGI::Application::Plugin::Redirect 
> module.
> 
> I check session conditions in cgi_prerun method like this:
> sub cgiapp_prerun {
>      my $self = shift;
>      my $rm = $self->get_current_runmode;
> 
>      # Get sess_id from URL
>      my $url_sess_id = $self->get_sess_id('url');
>      my $sess_id = $self->param(('sess_id');
> 
>      # 1. No sess_id in URL
>      if (!$url_sess_id) {
>          $self->delete_old_sess($sess_sess_id) if $sess_sess_id;
>          $self->create_new_sess;
>          return $self->redirect('warning.html');
>      }
> 
>      return $self;
> }
> 
> However, when I switch back to the plane CGI::Application module, everything 
> works very well.
> 
> I'm using fcgid (replacement for fcgi) module with Apache.
> I checked my fcgid and Apache configurations. Everything works properly.
> 
> If I use CGI::Application::FastCGI module and comment out 
> '$self->redirect_url('warning.html');' line - the application works correctly.
> 
> Could somebody tell me please why CGI::Application::FastCGI module doesn't 
> redirect to the proper HTML page when CGI::Application does it all the time?
> 
> Many thanks in advance,
> 
> Alex
> 
> 
> 
> #####  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/                 ##
> ##                                                            ##
> ################################################################
> 
> 
>       
> 
> #####  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