perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Todd Finney <>
Subject Re: Apache::Session::MySQL, light/heavy proxy, wedging
Date Wed, 31 Jan 2007 12:35:32 GMT
At 12:30 AM 1/31/2007 -0500, Perrin Harkins wrote:
>As for what's going wrong, my guess is that it has to do with the
>internal redirects that happen when you access / as opposed to
>/index.phtml.  You are trying to open the session in the
>HeaderParserHandler phase, so it's going to open a session, then do an
>internal redirect, and try to open the same session again, effectively

Wouldn't throwing a

         return DECLINED unless $r->is_initial_req;

at the top of the handler fix the problem, in that case?

>That's a 2.0 doc, but it applies to 1.0 as well: pnotes() increases
>the reference count to $session rather than copying it, so it doesn't
>get destroyed until after the internal redirect has completed and
>pnotes gets torn down.  If you use a temporary variable to hold the
>_session_id key, this will not happen and that may fix your problem.

That occurred to me, and one of the first things that I tried was something 
like this:

         my $temp_session=$session{_session_id};
         $r->pnotes('SESSION_ID', $temp_session);

It didn't change anything, so I decided that either (a) that wasn't the 
problem, or (b) after years of doing this I *still* don't fundamentally 
understand references.  Either conclusion made me uncomfortable, so I went 
looking for other potential solutions.

View raw message