Re: [http-state] non-ASCII cookie values (was Re: Closing Ticket 3: Public Suffixes)

Maciej Stachowiak <mjs@apple.com> Wed, 03 February 2010 02:05 UTC

Return-Path: <mjs@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 C1D0828C13F for <http-state@core3.amsl.com>; Tue, 2 Feb 2010 18:05:43 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -106.379
X-Spam-Level:
X-Spam-Status: No, score=-106.379 tagged_above=-999 required=5 tests=[AWL=0.220, 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 UBRTRhUyUaAe for <http-state@core3.amsl.com>; Tue, 2 Feb 2010 18:05: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 EDC7328C117 for <http-state@ietf.org>; Tue, 2 Feb 2010 18:05:42 -0800 (PST)
Received: from relay13.apple.com (relay13.apple.com [17.128.113.29]) by mail-out4.apple.com (Postfix) with ESMTP id 7F10489DD355 for <http-state@ietf.org>; Tue, 2 Feb 2010 18:06:23 -0800 (PST)
X-AuditID: 1180711d-b7b18ae000001001-f1-4b68da1f3f63
Received: from gertie.apple.com (gertie.apple.com [17.151.62.15]) by relay13.apple.com (Apple SCV relay) with SMTP id F4.69.04097.F1AD86B4; Tue, 2 Feb 2010 18:06:23 -0800 (PST)
MIME-version: 1.0
Content-transfer-encoding: 7bit
Content-type: text/plain; charset="us-ascii"
Received: from [17.151.86.222] by gertie.apple.com (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 32bit)) with ESMTPSA id <0KX8004JPTUMSV60@gertie.apple.com> for http-state@ietf.org; Tue, 02 Feb 2010 18:06:23 -0800 (PST)
From: Maciej Stachowiak <mjs@apple.com>
In-reply-to: <7789133a1002021737v2a50be07u3eea61a2fe870c79@mail.gmail.com>
Date: Tue, 02 Feb 2010 18:06:22 -0800
Message-id: <76513027-1536-489C-BDE0-8352B19FEB9A@apple.com>
References: <7789133a1002011014x5d587436j663a73bc92270a65@mail.gmail.com> <E1E6C8DE-EFB6-4226-93EE-AF20053FF315@apple.com> <Pine.LNX.4.64.1002012105180.6765@egate.xpasc.com> <7789133a1002012254oafc43aehe32f16e2640cbcdc@mail.gmail.com> <92003C09-05E0-4D51-B17B-05C26A41C209@apple.com> <7789133a1002021630n65bed91q2ffc975a94b1d2cb@mail.gmail.com> <143E98B7-BFA6-4F77-9685-E57FFD2449A6@apple.com> <7789133a1002021737v2a50be07u3eea61a2fe870c79@mail.gmail.com>
To: Adam Barth <ietf@adambarth.com>
X-Mailer: Apple Mail (2.1077)
X-Brightmail-Tracker: AAAAAQAAAZE=
Cc: http-state@ietf.org
Subject: Re: [http-state] non-ASCII cookie values (was Re: Closing Ticket 3: Public Suffixes)
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 02:05:43 -0000

On Feb 2, 2010, at 5:37 PM, Adam Barth wrote:

> On Tue, Feb 2, 2010 at 5:19 PM, Maciej Stachowiak <mjs@apple.com> wrote:
>> On Feb 2, 2010, at 4:30 PM, Adam Barth wrote:
>>> I'm happy to do whatever you and Ian think is best.  If the algorithm
>>> needed for HTML5 is sensible enough to be re-used by other string
>>> consumers, that would be a reason to put it in this document.  If the
>>> algorithm is non-sensical, we might be doing other applications a
>>> service keeping it HTML specific.
>> 
>> I don't actually know what algorithms current UAs use. In fact, I don't even know for sure whether non-ASCII characters in cookies are allowed at all. I guess someone needs to do some testing. I'll ask Ian if he has an opinion on which spec should define this.
> 
> I've added some basic tests using non-ASCII characters (in this case
> Chinese): charset0001, charset0002, charset0003.  IE, Firefox, Chrome,
> and Opera handle these cookies fine.  Safari does something strange
> that I haven't tracked down yet.
> 
> There's a long tail of things to test here, including invalid unicode
> in various encodings, but basic non-ASCII handling appears to do
> something somewhat sensible.  I haven't tested the document.cookie API
> at all yet.

Invalid unicode probably will not be an issue if browsers either treat these as raw bytes or treat it as a non-unicode encoding like Latin1.

Regards,
Maciej