MasonX::Request::WithApacheSession is a Perl module that integrates Apache::Session into Mason by adding methods to the Mason Request object available in all Mason components.
Any subrequests created by a request share the same session.
SYNOPSIS
In your httpd.conf file:
PerlSetVar MasonRequestClass MasonX::Request::WithApacheSession
PerlSetVar MasonSessionCookieDomain .example.com
PerlSetVar MasonSessionClass Apache::Session::File
PerlSetVar MasonSessionDirectory /tmp/sessions/data
PerlSetVar MasonSessionLockDirectory /tmp/sessions/locks
Or when creating an ApacheHandler object:
my $ah =
HTML::Mason::ApacheHandler->new
( request_class => 'MasonX::Request::WithApacheSession',
session_cookie_domain => '.example.com',
session_class => 'Apache::Session::File',
session_directory => '/tmp/sessions/data',
session_lock_directory => '/tmp/sessions/locks',
);
In a component:
$m->session->{foo} = 1;
if ( $m->session->{bar}{baz} > 1 ) { ... }
Product's homepage
Requirements:
· Perl