in reply to Apache::Cookie cookie set and cookie retrieved not the same?!

perldoc Apache::Cookie, look for the fetch class method.

Update: Also the parse and value instance methods.

Replies are listed 'Best First'.
Re^2: Getting data using Apache::Cookie
by neilwatson (Priest) on Aug 04, 2004 at 20:09 UTC
    Fetch gets the whole cookie? How do you get a specific piece from the fetched cookie? Is that was parse does?

    Given the cookie in my first post:

    my $cookies = Apache::Cookie->fetch(); my $value = $cookies->value;
    This does not work.

    Neil Watson
    watson-wilson.ca

      See the example from the libapreq source.

      ... my $r = shift; my $apr = Apache::Request->new($r); my $cookies = Apache::Cookie->new($r)->parse; my $c = $cookies->{'animals'}; my %zoo = (); %zoo = $c->value if $c; ...
        What does $c become? What is in %zoo? Why is it when my code gets unexpected results (see up-date at top of thread)?

        Neil Watson
        watson-wilson.ca