Alexandre Duret-Lutz <[EMAIL PROTECTED]> writes:

> I'm writing an HTTP client for SourceForge using LWP (libwww-perl 5.53).
> 
> I need to login to SourceForge by POSTing a form, to get an
> identification cookie before further processing.
> 
> The trouble is that the (queried) host 'sourceforge.net' sends me a
> cookie as follow:
> 
> Set-Cookie: username=BLABLABLA; expires=Wed, 17-Oct-01 22:37:23 GMT; path=/; 
>domain=.sourceforge.net
> 
> and HTTP::Cookies reject it with the this debug output:
> 
> HTTP::Cookies::extract_cookies: Domain .sourceforge.net does not match host 
>sourceforge.net
> 
> I have no idea who is right, it's the first time I work with
> cookies.  (Reading RFC 2109 I'd vote for HTTP::Cookies, however
> other browsers seems to accept these cookies just fine.)
> 
> I've modified my copy of Cookies.pm as follow to get around this.

Applied.  Thanks!

Regards,
Gisle

> 
> --- Cookies.pm
> +++ Cookies.pm
> @@ -322,7 +322,8 @@
>  
>       # Check domain
>       my $domain  = delete $hash{domain};
> -     if (defined($domain) && $domain ne $req_host) {
> +     if (defined($domain)
> +         && $domain ne $req_host && $domain ne ".$req_host") {
>           if ($domain !~ /\./ && $domain ne "local") {
>               LWP::Debug::debug("Domain $domain contains no dot");
>               next SET_COOKIE;

Reply via email to