Hi,

Gerald, great new features GetSession, SetupSession, etc...we hacked
together a version of this a few betas back, and we're happy to see that
it's now integrated into Embperl.  I have a few questions specific to my
implemenation:

We have a PerlAccessHandler which needs to grab a copy of %udat.  I want to
migrate away from our hack (which still works) and use SetupSession instead
to grab the hash.  Something like:

sub handler {
        my $r = shift;
      my $udat = HTML::Embperl::Req::SetupSession($r);
        # do stuff with udat, perhaps return denied, etc.
        HTML::Embperl::Req::CleanupSession();
        return OK;
}

This works great if I already have hit a page (outside the Access handler)
which has set a EMBPERL_UID...

  if (defined ($cookie_val) && ($cookie_val =~
/$cookie_name=(.*?)(\;|\s|$)/))

in Embperl.pm finds the existing cookie, and I have no problems accessing
%udat.

However, if the first page I hit is within the access handler, there will
not be a cookie set, and SetupSession will create a new session for me (but
it will not yet try to set the EMBPERL_UID cookie).

At first I tried:

      my $udat = HTML::Embperl::Req::SetupSession($r);
        HTML::Embperl::Req::RefreshSession();

to force a sending of the cookie, but realized that won't work because there
isn't really an HTML::Embperl::CurrReq yet -- this is before the content
phase (or at least I don't think).

If the document/location that I'm accessing that triggered the access
handler happens to be a an emperl doc, then Embperl knows to set the new
cookie.  If it isn't an embperl doc, the cookie never gets set.

I can throw in another hack into my access handler which will explicitly set
the EMBPERL_UID that from $udat->{_session_id}, but is there some other
sanctioned way of doing this?

Thanks for the help,
Alex

++  P.S. The Embperl docs (and perldoc) incorrectly label RefreshSession as
DeleteSession...


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to