Re: [http-state] Ticket 6: host-only cookies

Mark Pauley <mpauley@apple.com> Wed, 03 February 2010 19:39 UTC

Return-Path: <mpauley@apple.com>
X-Original-To: http-state@core3.amsl.com
Delivered-To: http-state@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 9A9B03A6CB3 for <http-state@core3.amsl.com>; Wed, 3 Feb 2010 11:39:44 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -106.599
X-Spam-Level:
X-Spam-Status: No, score=-106.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id H07bXjqTN2-7 for <http-state@core3.amsl.com>; Wed, 3 Feb 2010 11:39:43 -0800 (PST)
Received: from mail-out4.apple.com (mail-out4.apple.com [17.254.13.23]) by core3.amsl.com (Postfix) with ESMTP id 91AB03A6952 for <http-state@ietf.org>; Wed, 3 Feb 2010 11:39:43 -0800 (PST)
Received: from relay15.apple.com (relay15.apple.com [17.128.113.54]) by mail-out4.apple.com (Postfix) with ESMTP id E36F089F839E; Wed, 3 Feb 2010 11:40:26 -0800 (PST)
X-AuditID: 11807136-b7bafae000000e8d-77-4b69d12a4b1e
Received: from il0301a-dhcp87.apple.com (il0301a-dhcp87.apple.com [17.203.14.215]) (using TLS with cipher AES128-SHA (AES128-SHA/128 bits)) (Client did not present a certificate) by relay15.apple.com (Apple SCV relay) with SMTP id 90.4F.03725.A21D96B4; Wed, 3 Feb 2010 11:40:26 -0800 (PST)
Mime-Version: 1.0 (Apple Message framework v1077)
Content-Type: text/plain; charset="us-ascii"
From: Mark Pauley <mpauley@apple.com>
In-Reply-To: <7789133a1002021135o7d2b3aa4odb929341ab319137@mail.gmail.com>
Date: Wed, 03 Feb 2010 11:40:26 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <4B6C6C31-AB1A-4A05-AA03-FF0A82F2933F@apple.com>
References: <7789133a1001220050m56cc438x35099b7972639331@mail.gmail.com> <4B59B834.3030500@gmail.com> <4C374A2653EB5E43AF886CE70DFC567213CE9BE2B4@34093-MBX-C03.mex07a.mlsrvr.com> <7789133a1002012300k4627d9a2sad7f5b776c544487@mail.gmail.com> <4B6854C8.4040602@kristol.org> <7789133a1002020913p13f48804x1174904f3eec9c7d@mail.gmail.com> <4B687989.9080003@kristol.org> <7789133a1002021135o7d2b3aa4odb929341ab319137@mail.gmail.com>
To: Adam Barth <ietf@adambarth.com>
X-Mailer: Apple Mail (2.1077)
X-Brightmail-Tracker: AAAAAQAAAZE=
Cc: http-state <http-state@ietf.org>
Subject: Re: [http-state] Ticket 6: host-only cookies
X-BeenThere: http-state@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Discuss HTTP State Management Mechanism <http-state.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/http-state>, <mailto:http-state-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/http-state>
List-Post: <mailto:http-state@ietf.org>
List-Help: <mailto:http-state-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/http-state>, <mailto:http-state-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 03 Feb 2010 19:39:44 -0000

CFNetwork used to treat domain attributes starting without a dot literally, but I think we've gone back to prepending the dot due to compatibility issues.


On Feb 2, 2010, at 11:35 AM, Adam Barth wrote:

> On Tue, Feb 2, 2010 at 11:14 AM, Dave Kristol
> <dmk-http-state@kristol.org> wrote:
>> Adam Barth wrote:
>>> Do you mean that
>>> 
>>> Set-Cookie: foo=bar; Domain=example.com
>>> 
>>> and
>>> 
>>> Set-Cookie: foo=bar; Domain=.example.com
>>> 
>>> are treated differently by user agents?  That might be true according
>>> to 2109 (I'd have to check), but I don't think that's how user agents
>>> work in practice.  They appear to ignore the leading dot.  If you have
>>> a test case that show a difference, I'd be very interested in seeing
>>> it.
>> 
>> That is what I meant, and I do not have a test case.  That is what 2109
>> said, and I believe (though it's been many years now... ugh!) I adopted that
>> from Netscape's spec.  Generally speaking, the idea was that, in the absence
>> of Domain=, the cookie should be returned only to the server that sent it.
> 
> I believe this is the line of code in Firefox that causes the leading
> dot in the domain attribute to be ignored.
> 
> http://mxr.mozilla.org/mozilla-central/source/netwerk/cookie/src/nsCookieService.cpp#2159
> 
> There's a similar line of code in Chrome in the GetCookieDomainKey
> function in this file:
> 
> http://src.chromium.org/viewvc/chrome/trunk/src/net/base/cookie_monster.cc?view=markup
> 
> Here's the comment:
> 
>  // Get the normalized domain specified in cookie line.
>  // Note: The RFC says we can reject a cookie if the domain
>  // attribute does not start with a dot. IE/FF/Safari however, allow a cookie
>  // of the form domain=my.domain.com, treating it the same as
>  // domain=.my.domain.com -- for compatibility we do the same here.  Firefox
>  // also treats domain=.....my.domain.com like domain=.my.domain.com, but
>  // neither IE nor Safari do this, and we don't either.
> 
> Note that Firefox now acts like IE/Chrome/Safari in regards to
> Domain=.....my.domain.com
> 
> Adam
> _______________________________________________
> http-state mailing list
> http-state@ietf.org
> https://www.ietf.org/mailman/listinfo/http-state