I was having a problem using HTTP::Cookies with the Orion Web server /
Servlet engine, and found that it was sending a header:

Set-Cookie: name=value; Path=

This causes problems with HTTP::Cookies since path ends up being defined
but empty.

I'm not sure if the above header is legal or not, but it works for all
the major browsers so might as well be compatible...

Can be fixed easily by adding a line to extract_cookies():

        my $path = delete $hash{path};
        my $path_spec;
        if (defined $path) {
            $path_spec++;
            $self->_normalize_path($path) if $path =~ /%/;
>>>         $path = "/" unless length($path);
            if (!$netscape_cookies &&
                substr($req_path, 0, length($path)) ne $path) {
                LWP::Debug::debug("Path $path is not a prefix of
$req_path");
                next SET_COOKIE;
            }
        } else {
            $path = $req_path;
            $path =~ s,/[^/]*$,,;
            $path = "/" unless length($path);
        }


- Jake

Reply via email to