Okay, I'm obviously no expert but I see a problem ... I think? :
my $cookie = Apache::Cookie->fetch;
my $ref_cookie = ref $cookie;
returns 'HASH'
but
my $session = $cookies->{'session'}->value;
my $type = ref @session;
doesn't return anything, '' or (undef?). strange?
However:
my @session = $cookies->{'session'}->value;
returns the (almost) desired result as pairs and as they were originally
inserted from the standard CGI cookie. so i thought it was acceptable to
convert to a hash, knowing the list values are in pairs:
my %hash = $cookies->{'session'}->value;
will probably throw a warning or even an error without the defined
statement, but it gets past the immediate issue.
kirk
>-----Original Message-----
>From: Perrin Harkins [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, June 03, 2003 10:57 AM
>To: [EMAIL PROTECTED]
>Cc: Stas Bekman; modperl
>Subject: RE: Apache::Cookie
>
>
>On Tue, 2003-06-03 at 13:08, cap wrote:
>> it works just fine in my app, and 'just fine' maybe all that i need.
>
>The point is, it shouldn't work. You should not be getting a hash.
>What should work is this:
>
>my $session = defined $cookies->{'session'} ?
>$cookies->{'session'}->value : undef;
>
>The larger issue is fixing the Apache::Cookie docs. I would attempt to
>patch it if I understood what it's doing. Does anyone know what the API
>is returning when you call fetch()? An Apache::Table? Some other kind
>of object? It looks pretty bizarre to me, and it certainly isn't doing
>what the docs show.
>
>- Perrin
>