Here are the versions of stuff I am using: Apache: 2.0.49 mod_perl: 1.99_13 libapreq2: 2.02_02
The following is the code in the handler running under mp1:
my $cookies = Apache::Cookie->new($r)->parse;
eval {
tie (%HTML::Mason::Commands::session, 'Apache::Session::MySQL',
( $cookies->{'AF_SID'} ? $cookies->{'AF_SID'}->value() : undef ),
{ Handle => $main::SDBH, LockHandle => $main::SDBH });
};
# If the session is invalid, create a new session.
if ( $@ ) {
if ( $@ =~ m#^Object does not exist in the data store# ) {
tie (%HTML::Mason::Commands::session, 'Apache::Session::MySQL',
undef, { Handle => $main::SDBH, LockHandle => $main::SDBH });
undef $cookies->{'AF_SID'};
}
}
if ( !$cookies->{'AF_SID'} ) {
my $cookie = Apache::Cookie->new($r,
-name=>'AF_SID',
-value=>$HTML::Mason::Commands::session{_session_id},
-path => '/',
);
$r->err_header_out('Set-Cookie' => "$cookie");
$cookie->bake();
}
And here is what I am using for mp2:
my $cookies = Apache::Cookie->fetch($r);
eval {
tie (%HTML::Mason::Commands::session, 'Apache::Session::MySQL',
( $cookies->{'AF_SID'} ? $cookies->{'AF_SID'}->value() : undef ),
{ Handle => $main::SDBH, LockHandle => $main::SDBH });
};
# If the session is invalid, create a new session.
if ( $@ ) {
if ( $@ =~ m#^Object does not exist in the data store# ) {
tie (%HTML::Mason::Commands::session, 'Apache::Session::MySQL',
undef, { Handle => $main::SDBH, LockHandle => $main::SDBH });
undef $cookies->{'AF_SID'};
}
}
if ( !$cookies->{'AF_SID'} ) {
my $cookie = Apache::Cookie->new($r,
-name=>'AF_SID',
-value=>$HTML::Mason::Commands::session{_session_id},
-path => '/',
);
$rr->err_header_out('Set-Cookie' => "$cookie");
$cookie->bake();
}-- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
