perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Landrum <rland...@aol.net>
Subject Re: Perl Authentication Handler and Cookie Issue
Date Fri, 16 Feb 2007 19:17:04 GMT
Sumit Shah wrote:
> Hello,
> 
> I have a Mod Perl authentication handler and it needs to retrieve the 
> session id from a cookie. It is unable to retrieve any cookies and I get 
> the following error. It does not even print any of the cookies. I would 
> appreciate any help with this.
> 
> 
>      my $token = $cookies{'SessionID'}->value;
>      chomp($token);
>      $log->error("3. Session ID ==> $token");
>

You're trying to call a method against a value that may or may not 
exist.  That's a big no-no.

if(defined $cookies{'SessionID'}) {
   $token = $cookies{'SessionID'}->value;
}
else {
   $log->error("No SessionID cookie");
}

Rob

Mime
View raw message