perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerald Richter" <rich...@ecos.de>
Subject RE: intermittent %udat problems
Date Sat, 13 Nov 2004 12:39:13 GMT
> 
> I have been struggling with a %udat problem for a while 
> without luck. I am using %udat to store user id's when a user 
> is logs on, and then testing for the ID in later pages. 
> However, it only works, 50% of the time. I can log in, and 
> look a a few pages, then I get a not-logged-in error. If I 
> reload, I am OK for a page or two before getting the next 
> log-logged-on error. I suspect there is a problem with 
> caching or closure (based on previous discussions on this 
> list), but I don't see it where the problem is. 
> 

It looks like your session setup is not correctly setup. In this case %udat
works as normal Hash and you only get the same data as long as you hit the
same Apache child process.

How does your session setup look like?

You might also enable the dbgSession flag in EMBERL_DEBUG and watch the
embperl.log file to see what happen with your sessions.

Gerald


> Here is some code: 
> 
> On pages that need a log in, I do this:
> 
>     [- Execute ('require-login.epl') -]
> 
> and here is require-login.epl:
> 
>     [$ if $udat{uid} $]
> 
>         [- $user = App::Data::Users->retrieve(uid=>$udat{uid}); 
>            # using Class::DBI
>         -] 
> 
>     <P> You are logged in as [+ $user->firstname +]
>         [+ $user->lastname +] </P>
> 
>     [$ else $]
> 
>     [-  $r = shift;
>         $r->DeleteSession; 
>     -]
> 
>     [-  $http_headers_out{'Location'} =
>         "login-fail.html" -]
> 
>     [$ endif $]
> 
> Thanks, 
> 
> 
> --
> Eric Freed
> IT Manager
> New Rochelle Radiology
> 914-633-7700 x339
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message