I register a clean up handler to explicitly untie the session variable. I am
not
sure how to do this in the setup you have running...so I can't be of much
explicit help.

Jay

----- Original Message ----- 
From: "Ken Williams" <[EMAIL PROTECTED]>
To: "Perrin Harkins" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, January 18, 2002 1:53 AM
Subject: Re: Apache::Session getting DESTROYed in wrong order


> 
> On Friday, January 18, 2002, at 12:44 AM, Perrin Harkins wrote:
> 
> >> In a Mason context, which is where I'm using it, I do this in my
> >> top-level autohandler (ignore the main:: subroutines, they're just for
> >> pedagogy):
> >>
> >>
> >> <%init>
> >>   # 'local' so it's available to lower-level components
> >>   local *session;
> >>
> >>   my $dbh = &::get_dbh;
> >>   my $session_id = &::get_cookie('_session_id');
> >>   tie %session, 'Apache::Session::MySQL', $session_id,
> >>                {Handle => $dbh, LockHandle => $dbh};
> >>   ...
> >> </%init>
> >
> > Geez, that's awfully confusing to look at (local and typeglobs is not a
> > newbie-friendly combo).  Isn't there a simpler way?  What about putting
> > it in pnotes?
> 
> I don't think there's a simpler way.  Putting it in pnotes means that 
> all other components will also have to use $r->pnotes('session'), rather 
> than just using %session.
> 
> Perhaps "local(*session)" is better than "local *session"?  It at least 
> looks less like a "pointer to local".  ;-)
> 
>   -Ken
> 
> 

Reply via email to