perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Perrin Harkins" <phark...@gmail.com>
Subject Re: Perl Authentication Handler and Cookie Issue
Date Wed, 21 Feb 2007 00:08:17 GMT
On 2/20/07, Sumit Shah <sshah@gce2000.com> wrote:
> I printed out the contents of the Cookie attribute in the request header
> and I can see the cookie present in the header. I read all the contents
> into a hash and then try to check for its existence. The
> if(exists($hashMap{'SSOTokenID'})) condition fails. Does it have
> anything to do with data types?

No, Perl doesn't usually have those kinds of problems.

>       my $cookie = $r->headers_in->{'Cookie'};
>       my @cookieArray = split(";",$cookie);
>
>       my %hashMap;
>       my $cookieItem;
>       foreach $cookieItem (@cookieArray){
>                 my @subArray = split("=",$cookieItem);
>                 my $key = $subArray[0];
>                 my $value = $subArray[1];
>                 $hashMap{$key}=$value;
>       }
>      my $k;
>      my $v;
>       while ( ($k,$v) = each %hashMap ) {
>             $log->error("$k => $v");
>       }

What do you see log at this point?  A simpler way to dump a hash is like this:

use Data::Dumper; warn Dumper(\%hashMap);

- Perrin

Mime
View raw message