Subject: | Patch for Session/Generate/ModUsertrack.pm to work with MP2. |
The file Session/Generate/ModUsertrack.pm in Apache-Session-1.6 uses the 1.x way of using the Apache module. The attached (untested, but should work) patch allows it to work with mod_perl 1.x and mod_perl 2.0.x.
The patch is against version 1.6, but the file is no different in the 1.70_01 version.
- make Session::Generate::ModUsertrack work with MP2.
--- ./Session/Generate/ModUsertrack.pm 2001-10-11 10:43:32.000000000 -0700
+++ ./Session/Generate/ModUsertrack.pm.mp2 2005-09-07 16:01:11.798128185 -0700
@@ -15,8 +15,14 @@
if (!exists $cookies{$name} && MOD_PERL) {
# no cookies, try to steal from notes
- require Apache;
- my $r = Apache->request;
+ my $r;
+ if ( $ENV{MOD_PERL_API_VERION} == 2 ) {
+ require Apache2::RequestUtil;
+ $r = Apache2::RequestUtil->request;
+ } else {
+ require Apache;
+ $r = Apache->request;
+ }
%cookies = CGI::Cookie->parse($r->notes('cookie'));
}