perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerald Richter" <>
Subject RE: Can't locate (was: Problem with GetSession)
Date Fri, 10 Jun 2005 03:35:51 GMT

> > Is the called script a standalone CGI script or is it 
> executed under 
> > mod_perl?
> I would like to try both. Should both work?

Yes, it works, but your code has to be a little different, because when the
subrequest happend under mod_perl the session is already setup, while in the
CGI, because it's a new process, it has to be setup first.

 if ($Embperl::req)
	$udat = $Embperl::req -> GetSession() ;
	$udat = Embperl::Req::SetupSession() ;

In case you change something in the session data during your CGI, you need
to call

 if (!$Embperl::req)
	Embperl::Req::CleanupSession() ;

> and I have done 
> use Embperl;
> $udat = Embperl::Req::GetSession();
> in the called script, and it still gives the same error.

You see in the example above that I have changed the way I call GetSession.
This one should work. The other one does not work, because CurrReq () is an
old function, that does not exists anymore, so there is no way for Perl to
find. Sorry, I missed this during my last answer


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message