develooper Front page | perl.libwww | Postings from December 2001

HTTP::Cookies Domain Issue

Thread Next
From:
Mschilli1
Date:
December 20, 2001 14:00
Subject:
HTTP::Cookies Domain Issue
Message ID:
ce.1ec81601.2953b653@aol.com
Hi Gisle,

while using HTTP::Cookies, I realized that it behaves differently than most 
browsers do: If a cookie is being written to a  "domain" which is actually a 
hostname like in

    Set-cookie: name=val; path=/; domain=www.aol.com

all major browsers will accept this pseudo domain and replay the cookie to 
the hostname (like on http://www.aol.com). HTTP::Cookie, however, will store 
the cookie's domain as ".www.aol.com" and therefore *won't* replay it on 
http://www.aol.com. 
Not sure if this is possibly even somewhat against the original cookie spec 
-- but if you want HTTP::Cookie to be compliant with the major browsers, I 
think line 340 in HTTP::Cookies.pm 

    $domain = ".$domain" unless $domain =~ /^\./;

has to be deleted. What do you think?

-- Mike

Mike Schilli mschilli1@aol.com

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About