> Thanks for the help...I think the register_cleanup solution may step in
too
> late in the request process...
>
CleanupSession only writes the data and does some cleanup so the data
doesn't stay in %udat for the next request of the same process. So
register_cleanup is ok for that. (Of course it would be too late to set a
cookie, but CleanupSession doesn't do this anyway)
> > > HTML::Embperl::Req::CleanupSession();
> >
> > do not call CleanupSession here, Embperl will do it for you later. If
you
> > call CleanupSession here EMbperl doesn't have a chance to get the
>
> But it appears to have session data available to it that I set in the
> AccessHandler...
>
But only if it is an old session or you have set the Cookie Header inside
your AccessHandler. The Embperl can take the id from the cookie and reopen
the session.
> > $r -> register_cleanup (\&HTML::Embperl::Req::CleanupSession) ;
> >
> > This make sure that the session is written to disk and closed after the
> > request.
>
> This causes the process to hang (I'm guessing it's the lock on the $udat
in
> AccessHandler that Embperl::Execute waits and waits for)...and creates the
> following in my error log:
>
> [Thu Oct 26 17:22:30 2000] [error] Can't locate object method "SubReq" via
> package "Apache" at
> /usr/local/lib/perl5/site_perl/5.6.0/i686-linux/HTML/Embperl.pm line 1733.
>
That's because register_cleanup passes a Apache REquestobject as parameter
to CleanupSession, while CleanupSession wants to have an Embperl
Requestobject or undef.
Try to change at the start of CeanupSession in Embperl.pm from
my $r = shift || HTML::Embperl::CurrReq () ;
to
my $r = shift ;
$r = HTML::Embperl::CurrReq () if (!(ref ($r) =~ /^HTML::Embperl/));
does this change anything?
> If I go with my existing solution (calling
> HTML::Embperl::Req::CleanupSession as above) it appears to work...
>
Yes, but your session is opend (read from disk) and closed (write to disk if
modified) twice per request.
> > In cases where no Embperl page is processed, but you want to use Embperl
> > session management, you have to set the cookie on your own:
> >
> > $r -> header_out ("Set-Cookie" => "EMBPERL_UID=$udat->{_id}") ;
> > Let me know if this works for you
>
> Yes, this works great, and is what I had thrown in there as well. I may
> actually try to modify HTML::Embperl::Req::RefreshSession to include this
so
> I don't have to know how to set the cookie manually, but Embperl knows how
> to set it itself.
>
While your are right that this should be moved into Embperl, RefreshSession
isn't the right place, because it set's only a flag that causes the session
cookie to be resend, in case there is some session data. For you this
doesn't makes a differences, because you always have session data (because
of your AccessHandler), but in other situations, this may not the case. So I
prefer to have a separate function, which does send the cookie.
Gerald
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice: +49 6133 925151
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]