SPUG: Mason and FCGI

Jon Burdge jlb at io.com
Sat Oct 28 14:34:22 PDT 2006


I'm trying to setup a Mason site on a host where I need to use FCGI.  It's 
more or less working but I'm having a problem where arguments are 
persisting across multiple requests.  (Like, user1 fills in a 
form and POSTs his response, user2 selects some random page and the 
contents of user1's POST is visible on that page in %ARGS.)

My fcgi masonhandler is pretty simple, basically this:

my $h = HTML::Mason::CGIHandler->new( ... );
my $req = FCGI::Request();

while ($req->Accept() >= 0) {
   my $env = $req->GetEnvironment();
   my $request = $env->{REDIRECT_URL} || '/index.html';
   $h->handle_comp($request);
}

This is more or less copied from an example I found on the web (I've only 
used Mason in a mod_perl environment before.)  Is there something I need 
to do to reset the environment between requests?  I've spent quite a bit 
of time with perldoc and Data::Dumper and have not made any real progress.

Any tips would be welcome.

Jon


More information about the spug-list mailing list