Package: libmasonx-request-withapachesession-perl Version: 0.30-2 Severity: normal Tags: patch
I recently attempted to get this module working under FastCGI using the HTML::Mason::CGIHandler module -- which this module is apparently designed to support, as noted by its reference to the CGIHandler's presence in deciding how to operate. The CGIHandler exposes the CGI object (CGI::Fast in this case) as $m->cgi_object. This provides methods such as 'param' to query the submitted URL parameters, as needed to get the session ID from such a parameter. CGIHandler also offers a fake Apache object (HTML::Mason::FakeApache) as $m->cgi_request. This contains methods such as 'headers_in' and 'headers_out' to set and read HTTP headers, as needed to get and set the session ID via cookies. Apache::Session::Wrapper requires both of these capabilities. MasonX::Request::WithApacheSession is correctly passing the former, but is also passing the former in lieu of the latter. This prevents the module from working whatsoever in a CGI environment. The attached patch sends the correct objects when initialising Apache::Session::Wrapper. I believe this is the correct approach, and I now have session tracking set up identically to when I was using mod_perl. Note that I have not tested what effect this may have on MasonX::Request::WithMultiSession. However, given that it subclasses MasonX::Request::WithApacheSession, I believe this patch will fix both. -- System Information: Debian Release: 4.0 APT prefers unstable APT policy: (500, 'unstable'), (400, 'testing'), (300, 'stable') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/dash Kernel: Linux 2.6.16-2-686 Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8) Versions of packages libmasonx-request-withapachesession-perl depends on: ii libapache-request-perl 1.33-1 Generic Apache Request Library ii libapache-session-perl 1.81-1 Perl modules for keeping persisten ii libapache-session-wrapper-per 0.33-1 A simple wrapper around Apache::Se ii libhtml-mason-perl 1:1.35-1 HTML::Mason Perl module ii perl [perl5] 5.8.8-7 Larry Wall's Practical Extraction libmasonx-request-withapachesession-perl recommends no packages. -- no debconf information
--- /usr/share/perl5/MasonX/Request/WithApacheSession.pm 2005-11-18 10:47:31.000000000 -0500 +++ lib/MasonX/Request/WithApacheSession.pm 2007-05-16 15:00:50.000000000 -0400 @@ -87,9 +87,9 @@ param_object => $self->apache_req, ); } - elsif ( $self->can('cgi_object') ) + elsif ( $self->can('cgi_request') && $self->can('cgi_object') ) { - %extra = ( header_object => $self->cgi_object, + %extra = ( header_object => $self->cgi_request, param_object => $self->cgi_object, ); }
signature.asc
Description: Digital signature