Re: [http-state] Ticket 11: Character encoding for non-ASCII cookies values

Adam Barth <ietf@adambarth.com> Wed, 10 March 2010 23:18 UTC

Return-Path: <ietf@adambarth.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 2AF503A6837 for <http-state@core3.amsl.com>; Wed, 10 Mar 2010 15:18:36 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.977
X-Spam-Level:
X-Spam-Status: No, score=-1.977 tagged_above=-999 required=5 tests=[AWL=0.000, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622]
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 8bcpulntO81g for <http-state@core3.amsl.com>; Wed, 10 Mar 2010 15:18:33 -0800 (PST)
Received: from mail-gy0-f172.google.com (mail-gy0-f172.google.com [209.85.160.172]) by core3.amsl.com (Postfix) with ESMTP id AB3CD3A6819 for <http-state@ietf.org>; Wed, 10 Mar 2010 15:18:32 -0800 (PST)
Received: by gyg10 with SMTP id 10so2335858gyg.31 for <http-state@ietf.org>; Wed, 10 Mar 2010 15:18:33 -0800 (PST)
Received: by 10.100.200.20 with SMTP id x20mr3731423anf.171.1268263113537; Wed, 10 Mar 2010 15:18:33 -0800 (PST)
Received: from mail-iw0-f180.google.com (mail-iw0-f180.google.com [209.85.223.180]) by mx.google.com with ESMTPS id 23sm98926iwn.2.2010.03.10.15.18.31 (version=SSLv3 cipher=RC4-MD5); Wed, 10 Mar 2010 15:18:31 -0800 (PST)
Received: by iwn10 with SMTP id 10so2603678iwn.31 for <http-state@ietf.org>; Wed, 10 Mar 2010 15:18:31 -0800 (PST)
MIME-Version: 1.0
Received: by 10.231.148.83 with SMTP id o19mr342616ibv.39.1268263111086; Wed, 10 Mar 2010 15:18:31 -0800 (PST)
In-Reply-To: <5c4444771003021624qc0b00cet27e348cb6d023b08@mail.gmail.com>
References: <5c4444771003021624qc0b00cet27e348cb6d023b08@mail.gmail.com>
From: Adam Barth <ietf@adambarth.com>
Date: Wed, 10 Mar 2010 15:18:11 -0800
Message-ID: <5c4444771003101518w7e824436sc5a659b35ba664f2@mail.gmail.com>
To: http-state <http-state@ietf.org>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Subject: Re: [http-state] Ticket 11: Character encoding for non-ASCII cookies values
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, 10 Mar 2010 23:18:36 -0000

I'm going to close this ticket because no one objected to this resolution.

Adam


On Tue, Mar 2, 2010 at 4:24 PM, Adam Barth <ietf@adambarth.com> wrote:
> We had some earlier discussion about what to do with non-ASCII
> characters in cookie values.
>
> == On the wire ==
>
> * IE, Firefox, Chrome, and Opera seem to treat non-ASCII characters as
> opaque octets on the wire
> * Safari seems to drop cookies with non-ASCII characters (although
> Maciej said code inspection leads him to believe Safari's behavior is
> a bit more complicated).
>
> == In document.cookie ==
>
> In <http://github.com/abarth/http-state/blob/master/notes/2010-02-03-Julian-Reschke.txt>,
> Julian Reschke wrote:
> [[
> I just did a quick test with an ISO-8859-1 encoded cookie value,
> client-side javascript and "alert(document.cookie)":
> - IE and Firefox appear to treat the cookie as ISO-8859-1
> - Safari appears to ignore the cookie
> - Chrome and Opera appear to try to decode as UTF-8 (and returns a
> REPLACEMENT CHAR in place of the umlaut I tried)
> ]]
>
> == Proposal ==
>
> The draft treats the cookie values as opaque octets throughout for use
> on the wire.  I've added a SHOULD-level requirement to use a UTF8 when
> converting the octets to characters (e.g., for use in the user agent's
> user interface).
>
> Given that the encoding issue doesn't appear to affect
> interoperability on the wire, I think a SHOULD-level recommendation is
> appropriate here.  If specific APIs (e.g., document.cookie) have more
> specific needs, they can add additional requirements.
>
> Thoughts?
>
> Adam
>