[要約] RFC 2965は、HTTPにおいてサーバーがクライアント側に状態情報を保存・管理するための高度なメカニズム「Cookie2」の仕様を定義しています。従来のクッキーよりも詳細な属性管理、セキュリティ設定、およびポート番号指定などを可能にするヘッダー形式(Set-Cookie2, Cookie2)を規定しています。ステートレスなHTTPプロトコル上で、セッション管理やカスタマイズされたサービスを一貫したルールで安全に実現することを目的としています。
Network Working Group D. Kristol
Request for Comments: 2965 Bell Laboratories, Lucent Technologies
Obsoletes: 2109 L. Montulli
Category: Standards Track Epinions.com, Inc.
October 2000
HTTP State Management Mechanism
HTTP 状態管理メカニズム
Status of this Memo
本文書の状態
This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet Official Protocol Standards" (STD 1) for the standardization state and status of this protocol. Distribution of this memo is unlimited.
この文書は、インターネットコミュニティ向けのインターネット標準化過程のプロトコルを規定し、改善に向けた議論や提案を求めるものです。このプロトコルの標準化状況については、「Internet Official Protocol Standards」(STD 1)の最新版を参照してください。本メモは無制限に配布できます。
Copyright Notice
著作権表示
Copyright (C) The Internet Society (2000). All Rights Reserved.
Copyright (C) The Internet Society (2000). All Rights Reserved.
IESG Note
IESGノート
The IESG notes that this mechanism makes use of the .local top-level domain (TLD) internally when handling host names that don't contain any dots, and that this mechanism might not work in the expected way should an actual .local TLD ever be registered.
IESGは、このメカニズムが、ドットを含まないホスト名を処理する際に内部で.localトップレベルドメイン(TLD)を使用することを指摘しています。実際に.local TLDが登録された場合、このメカニズムは想定どおりに機能しない可能性があります。
Abstract
概要
This document specifies a way to create a stateful session with Hypertext Transfer Protocol (HTTP) requests and responses. It describes three new headers, Cookie, Cookie2, and Set-Cookie2, which carry state information between participating origin servers and user agents. The method described here differs from Netscape's Cookie proposal [Netscape], but it can interoperate with HTTP/1.0 user agents that use Netscape's method. (See the HISTORICAL section.)
この文書は、Hypertext Transfer Protocol(HTTP)のリクエストとレスポンスを使って状態を保持するセッションを作成する方法を規定します。参加するオリジンサーバーとユーザーエージェントの間で状態情報を運ぶ3つの新しいヘッダー、Cookie、Cookie2、Set-Cookie2について説明します。ここで説明する方法はNetscapeのCookie提案[Netscape]とは異なりますが、Netscape方式を使うHTTP/1.0ユーザーエージェントと相互運用できます(「HISTORICAL」節を参照)。
This document reflects implementation experience with RFC 2109 and obsoletes it.
この文書は、RFC 2109の実装経験を反映しており、RFC 2109を廃止します。
Host name (HN) means either the host domain name (HDN) or the numeric Internet Protocol (IP) address of a host. The fully qualified domain name is preferred; use of numeric IP addresses is strongly discouraged.
ホスト名(HN)は、ホストドメイン名(HDN)またはホストの数値形式のInternet Protocol(IP)アドレスを指します。完全修飾ドメイン名を推奨します。数値IPアドレスの使用は強く推奨しません。
The terms request-host and request-URI refer to the values the client would send to the server as, respectively, the host (but not port) and abs_path portions of the absoluteURI (http_URL) of the HTTP request line. Note that request-host is a HN.
request-hostとrequest-URIは、HTTPリクエスト行のabsoluteURI(http_URL)のうち、クライアントがそれぞれサーバーに送るホスト(ポートを除く)部分とabs_path部分を指します。request-hostはHNです。
The term effective host name is related to host name. If a host name contains no dots, the effective host name is that name with the string .local appended to it. Otherwise the effective host name is the same as the host name. Note that all effective host names contain at least one dot.
effective host nameはhost nameに関連する用語です。ホスト名にドットが含まれない場合、effective host nameはその名前の末尾に文字列 .local を追加したものです。それ以外の場合、effective host nameはhost nameと同じです。すべてのeffective host nameには少なくとも1つのドットが含まれます。
The term request-port refers to the port portion of the absoluteURI (http_URL) of the HTTP request line. If the absoluteURI has no explicit port, the request-port is the HTTP default, 80. The request-port of a cookie is the request-port of the request in which a Set-Cookie2 response header was returned to the user agent.
request-portは、HTTPリクエスト行のabsoluteURI(http_URL)のポート部分を指します。absoluteURIにポートが明示されていない場合、request-portはHTTPの既定値である80です。Cookieのrequest-portは、Set-Cookie2レスポンスヘッダーがユーザーエージェントに返されたリクエストのrequest-portです。
Host names can be specified either as an IP address or a HDN string. Sometimes we compare one host name with another. (Such comparisons SHALL be case-insensitive.) Host A's name domain-matches host B's if
ホスト名は、IPアドレスまたはHDN文字列で指定できます。ホスト名どうしを比較することがあります(この比較では大文字と小文字を区別してはなりません (SHALL))。ホストAの名前がホストBのドメインに一致するのは、次の場合です。
* their host name strings string-compare equal; or
* それぞれのホスト名文字列が文字列比較で等しい場合、または
* A is a HDN string and has the form NB, where N is a non-empty name string, B has the form .B', and B' is a HDN string. (So, x.y.com domain-matches .Y.com but not Y.com.)
* AがHDN文字列で、NBの形式を持ち、Nが空でない名前文字列であり、Bが .B’ の形式で、B’ がHDN文字列である場合です(たとえば、x.y.comは .Y.com にはドメイン一致しますが、Y.comには一致しません)。
Note that domain-match is not a commutative operation: a.b.c.com domain-matches .c.com, but not the reverse.
ドメイン一致は可換ではありません。たとえば、a.b.c.comは .c.comにドメイン一致しますが、その逆は成り立ちません。
The reach R of a host name H is defined as follows:
ホスト名Hの到達範囲Rを次のように定義します。
* If
* 次の条件を満たす場合:
- H is the host domain name of a host; and,
- Hがホストのホストドメイン名であり、
- H has the form A.B; and
- HがA.Bの形式であり、
- A has no embedded (that is, interior) dots; and
- Aに内部ドットがなく、かつ
- B has at least one embedded dot, or B is the string "local". then the reach of H is .B.
- Bに内部ドットが1つ以上含まれるか、Bが文字列 "local" である場合、Hの到達範囲は .B です。
* Otherwise, the reach of H is H.
* それ以外の場合、Hの到達範囲はHです。
For two strings that represent paths, P1 and P2, P1 path-matches P2 if P2 is a prefix of P1 (including the case where P1 and P2 string-compare equal). Thus, the string /tec/waldo path-matches /tec.
パスを表す2つの文字列P1とP2について、P2がP1の接頭辞であれば(P1とP2が文字列比較で等しい場合を含みます)、P1はP2にパスマッチします。たとえば、文字列 /tec/waldo は /tec にパスマッチします。
Because it was used in Netscape's original implementation of state management, we will use the term cookie to refer to the state information that passes between an origin server and user agent, and that gets stored by the user agent.
状態管理の初期実装でNetscapeがこの用語を使ったことから、ここではcookieを、オリジンサーバーとユーザーエージェントの間で受け渡され、ユーザーエージェントに保存される状態情報を指す語として使います。
The key words "MAY", "MUST", "MUST NOT", "OPTIONAL", "RECOMMENDED", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT" in this document are to be interpreted as described in RFC 2119 [RFC2119].
この文書で使うキーワード "MAY"、"MUST"、"MUST NOT"、"OPTIONAL"、"RECOMMENDED"、"REQUIRED"、"SHALL"、"SHALL NOT"、"SHOULD"、"SHOULD NOT" は、RFC 2119 [RFC2119] の記述に従って解釈します。
This document describes a way to create stateful sessions with HTTP requests and responses. Currently, HTTP servers respond to each client request without relating that request to previous or subsequent requests; the state management mechanism allows clients and servers that wish to exchange state information to place HTTP requests and responses within a larger context, which we term a "session". This context might be used to create, for example, a "shopping cart", in which user selections can be aggregated before purchase, or a magazine browsing system, in which a user's previous reading affects which offerings are presented.
この文書では、HTTPリクエストとレスポンスを使って状態を保持するセッションを作成する方法を説明します。現在のHTTPサーバーは、各クライアントリクエストをそれ以前または以後のリクエストと関連付けずに応答します。状態管理メカニズムを使うと、状態情報を交換するクライアントとサーバーは、HTTPリクエストとレスポンスをより大きな文脈、すなわち「セッション」の中に位置付けられます。たとえば、購入前にユーザーが選んだ商品を集約する「ショッピングカート」や、ユーザーが以前に読んだ内容に応じて表示する記事を変える雑誌閲覧システムに利用できます。
Neither clients nor servers are required to support cookies. A server MAY refuse to provide content to a client that does not return the cookies it sends.
クライアントにもサーバーにもCookieをサポートする義務はありません。サーバーは、送信したCookieを返さないクライアントへのコンテンツ提供を拒否してもかまいません (MAY)。
We describe here a way for an origin server to send state information to the user agent, and for the user agent to return the state information to the origin server. The goal is to have a minimal impact on HTTP and user agents.
ここでは、オリジンサーバーがユーザーエージェントに状態情報を送り、ユーザーエージェントがその情報をオリジンサーバーに返す方法を説明します。この方式は、HTTPとユーザーエージェントへの影響を最小限に抑えることを目指します。
The two state management headers, Set-Cookie2 and Cookie, have common syntactic properties involving attribute-value pairs. The following grammar uses the notation, and tokens DIGIT (decimal digits), token (informally, a sequence of non-special, non-white space characters), and http_URL from the HTTP/1.1 specification [RFC2616] to describe their syntax.
2つの状態管理ヘッダーSet-Cookie2とCookieには、属性と値の組に関する共通の構文上の性質があります。以下の文法では、HTTP/1.1仕様[RFC2616]の記法、トークンDIGIT(10進数字)、token(非公式には、特殊文字でも空白文字でもない文字の並び)、およびhttp_URLを使って構文を示します。
av-pairs = av-pair *(";" av-pair)
av-pair = attr ["=" value] ; optional value
attr = token
value = token | quoted-string
Attributes (names) (attr) are case-insensitive. White space is permitted between tokens. Note that while the above syntax description shows value as optional, most attrs require them.
属性名(attr)は大文字と小文字を区別しません。tokenの間には空白を入れることができます。上記の構文ではvalueを省略可能としていますが、ほとんどのattrではvalueが必要です。
NOTE: The syntax above allows whitespace between the attribute and the = sign.
注: 上記の構文では、属性と等号(=)の間に空白を入れることができます。
3.2.1 General The origin server initiates a session, if it so desires. To do so, it returns an extra response header to the client, Set-Cookie2. (The details follow later.)
3.2.1 一般: オリジンサーバーは、必要に応じてセッションを開始します。そのために、クライアントへSet-Cookie2という追加のレスポンスヘッダーを返します(詳細は後述します)。
A user agent returns a Cookie request header (see below) to the origin server if it chooses to continue a session. The origin server MAY ignore it or use it to determine the current state of the session. It MAY send back to the client a Set-Cookie2 response header with the same or different information, or it MAY send no Set-Cookie2 header at all. The origin server effectively ends a session by sending the client a Set-Cookie2 header with Max-Age=0.
ユーザーエージェントは、セッションを継続する場合、Cookieリクエストヘッダー(後述)をオリジンサーバーに返します。オリジンサーバーはそのヘッダーを無視するか、セッションの現在の状態を判断するために使ってもかまいません (MAY)。同じ情報または異なる情報を含むSet-Cookie2レスポンスヘッダーをクライアントに返してもかまいません (MAY)。Set-Cookie2ヘッダーをまったく返さなくてもかまいません (MAY)。オリジンサーバーは、Max-Age=0を指定したSet-Cookie2ヘッダーをクライアントに送ることで、実質的にセッションを終了します。
Servers MAY return Set-Cookie2 response headers with any response. User agents SHOULD send Cookie request headers, subject to other rules detailed below, with every request.
サーバーは、どのレスポンスにもSet-Cookie2レスポンスヘッダーを含めてかまいません (MAY)。ユーザーエージェントは、後述する他の規則に従い、各リクエストにCookieリクエストヘッダーを含めるべきです (SHOULD)。
An origin server MAY include multiple Set-Cookie2 headers in a response. Note that an intervening gateway could fold multiple such headers into a single header.
オリジンサーバーは、1つのレスポンスに複数のSet-Cookie2ヘッダーを含めてもかまいません (MAY)。途中のゲートウェイが、複数のヘッダーを1つにまとめる場合があることに注意してください。
3.2.2 Set-Cookie2 Syntax The syntax for the Set-Cookie2 response header is
3.2.2 Set-Cookie2の構文: Set-Cookie2レスポンスヘッダーの構文は次のとおりです。
set-cookie = "Set-Cookie2:" cookies
cookies = 1#cookie
cookie = NAME "=" VALUE *(";" set-cookie-av)
NAME = attr
VALUE = value
set-cookie-av = "Comment" "=" value
| "CommentURL" "=" <"> http_URL <">
| "Discard"
| "Domain" "=" value
| "Max-Age" "=" value
| "Path" "=" value
| "Port" [ "=" <"> portlist <"> ]
| "Secure"
| "Version" "=" 1*DIGIT
portlist = 1#portnum
portnum = 1*DIGIT
Informally, the Set-Cookie2 response header comprises the token Set-Cookie2:, followed by a comma-separated list of one or more cookies. Each cookie begins with a NAME=VALUE pair, followed by zero or more semi-colon-separated attribute-value pairs. The syntax for attribute-value pairs was shown earlier. The specific attributes and the semantics of their values follows. The NAME=VALUE attribute-value pair MUST come first in each cookie. The others, if present, can occur in any order. If an attribute appears more than once in a cookie, the client SHALL use only the value associated with the first appearance of the attribute; a client MUST ignore values after the first.
概略として、Set-Cookie2レスポンスヘッダーは、token Set-Cookie2: に続いて、1つ以上のCookieをコンマで区切って並べたものです。各CookieはNAME=VALUEの組で始まり、その後にセミコロンで区切った属性と値の組が0個以上続きます。属性と値の組の構文は前述のとおりです。属性とその値の意味は以下で説明します。NAME=VALUEの組は各Cookieの先頭に置かなければなりません (MUST)。残りの属性は、存在する場合、任意の順序で現れてかまいません。1つのCookieに同じ属性が複数回現れた場合、クライアントはその属性の最初の出現に対応する値だけを使わなければなりません (SHALL)。クライアントは2回目以降の値を無視しなければなりません (MUST)。
The NAME of a cookie MAY be the same as one of the attributes in this specification. However, because the cookie's NAME must come first in a Set-Cookie2 response header, the NAME and its VALUE cannot be confused with an attribute-value pair.
CookieのNAMEは、この仕様で定義する属性のいずれかと同じでもかまいません (MAY)。ただし、Set-Cookie2レスポンスヘッダーではCookieのNAMEが先頭に来るため、NAMEとVALUEを属性と値の組と取り違えることはありません。
NAME=VALUE REQUIRED. The name of the state information ("cookie") is NAME, and its value is VALUE. NAMEs that begin with $ are reserved and MUST NOT be used by applications.
NAME=VALUE 必須 (REQUIRED)。状態情報(「cookie」)の名前がNAME、その値がVALUEです。$で始まるNAMEは予約されており、アプリケーションで使用してはなりません (MUST NOT)。
The VALUE is opaque to the user agent and may be anything the origin server chooses to send, possibly in a server-selected printable ASCII encoding. "Opaque" implies that the content is of interest and relevance only to the origin server. The content may, in fact, be readable by anyone that examines the Set-Cookie2 header.
VALUEはユーザーエージェントにとって不透明であり、オリジンサーバーが送信するものを何でも指定できます。サーバーが選んだ印字可能なASCIIエンコーディングを使うこともできます。「不透明」とは、その内容がオリジンサーバーだけにとって関心や関連性のある情報であることを意味します。実際には、Set-Cookie2ヘッダーを調べる人なら誰でも内容を読める場合があります。
Comment=value OPTIONAL. Because cookies can be used to derive or store private information about a user, the value of the Comment attribute allows an origin server to document how it intends to use the cookie. The user can inspect the information to decide whether to initiate or continue a session with this cookie. Characters in value MUST be in UTF-8 encoding. [RFC2279]
Comment=value 任意 (OPTIONAL)。Cookieを使ってユーザーの個人情報を推測または保存できるため、Comment属性の値を使って、オリジンサーバーはCookieの用途を説明できます。ユーザーはその情報を確認し、このCookieを使うセッションを開始または継続するか判断できます。value内の文字はUTF-8で符号化しなければなりません (MUST) [RFC2279]。
CommentURL="http_URL" OPTIONAL. Because cookies can be used to derive or store private information about a user, the CommentURL attribute allows an origin server to document how it intends to use the cookie. The user can inspect the information identified by the URL to decide whether to initiate or continue a session with this cookie.
CommentURL="http_URL" 任意 (OPTIONAL)。Cookieを使ってユーザーの個人情報を推測または保存できるため、CommentURL属性を使って、オリジンサーバーはCookieの用途を説明できます。ユーザーはURLが示す情報を確認し、このCookieを使うセッションを開始または継続するか判断できます。
Discard OPTIONAL. The Discard attribute instructs the user agent to discard the cookie unconditionally when the user agent terminates.
Discard 任意 (OPTIONAL)。Discard属性は、ユーザーエージェントが終了したときにCookieを無条件に破棄するよう指示します。
Domain=value OPTIONAL. The value of the Domain attribute specifies the domain for which the cookie is valid. If an explicitly specified value does not start with a dot, the user agent supplies a leading dot.
Domain=value 任意 (OPTIONAL)。Domain属性の値は、Cookieが有効となるドメインを指定します。明示された値がドットで始まらない場合、ユーザーエージェントは先頭にドットを付けます。
Max-Age=value OPTIONAL. The value of the Max-Age attribute is delta-seconds, the lifetime of the cookie in seconds, a decimal non-negative integer. To handle cached cookies correctly, a client SHOULD calculate the age of the cookie according to the age calculation rules in the HTTP/1.1 specification [RFC2616]. When the age is greater than delta-seconds seconds, the client SHOULD discard the cookie. A value of zero means the cookie SHOULD be discarded immediately.
Max-Age=value 任意 (OPTIONAL)。Max-Age属性の値はdelta-secondsであり、Cookieの有効期間を秒数で表す、符号なしの10進整数です。キャッシュされたCookieを正しく扱うため、クライアントはHTTP/1.1仕様[RFC2616]の経過時間計算規則に従ってCookieの経過時間を計算すべきです (SHOULD)。その経過時間がdelta-secondsを超えた場合、クライアントはCookieを破棄すべきです (SHOULD)。値が0の場合、Cookieは直ちに破棄すべきです (SHOULD)。
Path=value OPTIONAL. The value of the Path attribute specifies the subset of URLs on the origin server to which this cookie applies.
Path=value 任意 (OPTIONAL)。Path属性の値は、このCookieがオリジンサーバー上のどのURL群に適用されるかを指定します。
Port[="portlist"] OPTIONAL. The Port attribute restricts the port to which a cookie may be returned in a Cookie request header. Note that the syntax REQUIREs quotes around the OPTIONAL portlist even if there is only one portnum in portlist.
Port[="portlist"] 任意 (OPTIONAL)。Port属性は、CookieリクエストヘッダーでCookieを返せるポートを制限します。portlistにportnumが1つしかない場合でも、構文上、任意指定のportlist (OPTIONAL) を引用符で囲む必要があることに注意してください。
Secure OPTIONAL. The Secure attribute (with no value) directs the user agent to use only (unspecified) secure means to contact the origin server whenever it sends back this cookie, to protect the confidentially and authenticity of the information in the cookie.
Secure 任意 (OPTIONAL)。値を持たないSecure属性は、このCookieを返すたびに、Cookie内の情報の機密性と完全性を保護するため、ユーザーエージェントにオリジンサーバーへの接続で(方式は規定しない)安全な手段だけを使うよう指示します。
The user agent (possibly with user interaction) MAY determine what level of security it considers appropriate for "secure" cookies. The Secure attribute should be considered security advice from the server to the user agent, indicating that it is in the session's interest to protect the cookie contents. When it sends a "secure" cookie back to a server, the user agent SHOULD use no less than the same level of security as was used when it received the cookie from the server.
ユーザーエージェントは(ユーザーの操作を伴う場合もあります)、"secure" Cookieに適切と考えるセキュリティレベルを決めてもかまいません (MAY)。Secure属性は、Cookieの内容を保護することがセッションに有益であると示す、サーバーからユーザーエージェントへのセキュリティ上の助言として扱うべきです。"secure" Cookieをサーバーへ返すとき、ユーザーエージェントは、そのCookieをサーバーから受け取ったときと同等以上のセキュリティレベルを使うべきです (SHOULD)。
Version=value REQUIRED. The value of the Version attribute, a decimal integer, identifies the version of the state management specification to which the cookie conforms. For this specification, Version=1 applies.
Version=value 必須 (REQUIRED)。10進整数であるVersion属性の値は、Cookieが準拠する状態管理仕様のバージョンを示します。この仕様ではVersion=1を適用します。
3.2.3 Controlling Caching An origin server must be cognizant of the effect of possible caching of both the returned resource and the Set-Cookie2 header. Caching "public" documents is desirable. For example, if the origin server wants to use a public document such as a "front door" page as a sentinel to indicate the beginning of a session for which a Set-Cookie2 response header must be generated, the page SHOULD be stored in caches "pre-expired" so that the origin server will see further requests. "Private documents", for example those that contain information strictly private to a session, SHOULD NOT be cached in shared caches.
3.2.3 キャッシュ制御: オリジンサーバーは、返却するリソースとSet-Cookie2ヘッダーのそれぞれがキャッシュされる可能性と、その影響を把握しておく必要があります。"public"文書のキャッシュは望ましいものです。たとえば、オリジンサーバーが"front door"ページのような公開文書を、セッション開始を示す目印として使い、そのセッション用にSet-Cookie2レスポンスヘッダーを生成する場合、オリジンサーバーが後続のリクエストを受け取れるよう、そのページをキャッシュ内で"pre-expired"状態にしておくべきです (SHOULD)。セッションだけに関する情報を含む文書などの"private documents"は、共有キャッシュに保存すべきではありません (SHOULD NOT)。
If the cookie is intended for use by a single user, the Set-Cookie2 header SHOULD NOT be cached. A Set-Cookie2 header that is intended to be shared by multiple users MAY be cached.
Cookieが1人のユーザーだけに使われる場合、Set-Cookie2ヘッダーをキャッシュすべきではありません (SHOULD NOT)。複数のユーザーで共有することを意図したSet-Cookie2ヘッダーは、キャッシュしてもかまいません (MAY)。
The origin server SHOULD send the following additional HTTP/1.1 response headers, depending on circumstances:
Origin Serverは、状況に応じて、次の追加のHTTP/1.1応答ヘッダーを送信すべきです (SHOULD)。
* To suppress caching of the Set-Cookie2 header:
* Set-Cookie2ヘッダーのキャッシュを抑制するには:
Cache-control: no-cache="set-cookie2"
Cache-control: no-cache="set-cookie2"
and one of the following:
次のいずれかも指定します:
* To suppress caching of a private document in shared caches:
* 共有キャッシュ内でのprivate文書のキャッシュを抑制するには:
Cache-control: private
Cache-control: private
* To allow caching of a document and require that it be validated before returning it to the client:
* 文書のキャッシュを許可し、クライアントに返す前に検証するよう求めるには:
Cache-Control: must-revalidate, max-age=0
Cache-Control: must-revalidate, max-age=0
* To allow caching of a document, but to require that proxy caches (not user agent caches) validate it before returning it to the client:
* 文書のキャッシュを許可し、クライアントに返す前にプロキシキャッシュ(ユーザーエージェントのキャッシュは除く)で検証するよう求めるには:
Cache-Control: proxy-revalidate, max-age=0
Cache-Control: proxy-revalidate, max-age=0
* To allow caching of a document and request that it be validated before returning it to the client (by "pre-expiring" it):
* 文書のキャッシュを許可し、クライアントに返す前に検証するよう求めるには(文書を"pre-expire"状態にします):
Cache-control: max-age=0
Cache-control: max-age=0
Not all caches will revalidate the document in every case.
すべてのキャッシュがすべての場合にドキュメントを再検証するわけではありません。
HTTP/1.1 servers MUST send Expires: old-date (where old-date is a date long in the past) on responses containing Set-Cookie2 response headers unless they know for certain (by out of band means) that there are no HTTP/1.0 proxies in the response chain. HTTP/1.1 servers MAY send other Cache-Control directives that permit caching by HTTP/1.1 proxies in addition to the Expires: old-date directive; the Cache-Control directive will override the Expires: old-date for HTTP/1.1 proxies.
HTTP/1.1サーバーは、応答経路にHTTP/1.0プロキシがないことを帯域外の方法で確実に把握している場合を除き、Set-Cookie2レスポンスヘッダーを含むレスポンスにExpires: old-date(old-dateは十分過去の日付です)を設定しなければなりません (MUST)。HTTP/1.1サーバーは、Expires: old-dateに加えて、HTTP/1.1プロキシでのキャッシュを許可する他のCache-Controlディレクティブを送信してもかまいません (MAY)。Cache-Controlディレクティブは、HTTP/1.1プロキシに対してExpires: old-dateより優先されます。
3.3.1 Interpreting Set-Cookie2 The user agent keeps separate track of state information that arrives via Set-Cookie2 response headers from each origin server (as distinguished by name or IP address and port). The user agent MUST ignore attribute-value pairs whose attribute it does not recognize. The user agent applies these defaults for optional attributes that are missing:
3.3.1 Set-Cookie2の解釈: ユーザーエージェントは、名前またはIPアドレスとポートの組み合わせで区別される各オリジンサーバーから、Set-Cookie2レスポンスヘッダーを介して届く状態情報を個別に管理します。ユーザーエージェントは、認識できない属性を含む属性と値の組を無視しなければなりません (MUST)。ユーザーエージェントは、省略された任意属性に次の既定値を適用します。
Discard The default behavior is dictated by the presence or absence of a Max-Age attribute.
Discard: Max-Age属性の有無によって既定の動作が決まります。
Domain Defaults to the effective request-host. (Note that because there is no dot at the beginning of effective request-host, the default Domain can only domain-match itself.)
Domain: 既定値はeffective request-hostです(effective request-hostの先頭にはドットがないため、既定のDomainはそれ自体にしかドメイン一致しません)。
Max-Age The default behavior is to discard the cookie when the user agent exits.
Max-Age: 既定の動作では、ユーザーエージェントの終了時にCookieを破棄します。
Path Defaults to the path of the request URL that generated the Set-Cookie2 response, up to and including the right-most /.
Path: Set-Cookie2レスポンスを生成したリクエストURLのパスを既定値とします。パスの右端にある / までを含みます。
Port The default behavior is that a cookie MAY be returned to any request-port.
Port: 既定の動作では、Cookieを任意のrequest-portに返してもかまいません (MAY)。
Secure If absent, the user agent MAY send the cookie over an insecure channel.
Secure: Secure属性がない場合、ユーザーエージェントは安全でないチャネルでCookieを送信してもかまいません (MAY)。
3.3.2 Rejecting Cookies To prevent possible security or privacy violations, a user agent rejects a cookie according to rules below. The goal of the rules is to try to limit the set of servers for which a cookie is valid, based on the values of the Path, Domain, and Port attributes and the request-URI, request-host and request-port.
3.3.2 Cookieの拒否: セキュリティまたはプライバシー上の問題を防ぐため、ユーザーエージェントは以下の規則に従ってCookieを拒否します。これらの規則は、Path、Domain、Port属性とrequest-URI、request-host、request-portの値に基づいて、Cookieが有効となるサーバーの範囲を制限することを目的とします。
A user agent rejects (SHALL NOT store its information) if the Version attribute is missing. Moreover, a user agent rejects (SHALL NOT store its information) if any of the following is true of the attributes explicitly present in the Set-Cookie2 response header:
Version属性がない場合、ユーザーエージェントはCookieを拒否し、その情報を保存してはなりません (SHALL NOT)。また、Set-Cookie2レスポンスヘッダーに明示された属性について、次のいずれかが該当する場合も、Cookieを拒否し、その情報を保存してはなりません (SHALL NOT):
* The value for the Path attribute is not a prefix of the request-URI.
* Path属性の値がrequest-URIの接頭辞ではない。
* The value for the Domain attribute contains no embedded dots, and the value is not .local.
* Domain属性の値に内部ドットがなく、その値が .local でもない。
* The effective host name that derives from the request-host does not domain-match the Domain attribute.
* request-hostから得られるeffective host nameが、Domain属性にドメイン一致しない。
* The request-host is a HDN (not IP address) and has the form HD, where D is the value of the Domain attribute, and H is a string that contains one or more dots.
* request-hostがHDN(IPアドレスではない)で、HDの形式を持つ。ここでDはDomain属性の値、Hは1つ以上のドットを含む文字列です。
* The Port attribute has a "port-list", and the request-port was not in the list.
* Port属性に"port-list"が指定されているが、request-portがそのリストに含まれていない。
Examples:
例:
* A Set-Cookie2 from request-host y.x.foo.com for Domain=.foo.com would be rejected, because H is y.x and contains a dot.
* request-hostがy.x.foo.comで、Domain=.foo.comの場合、Hがy.xでドットを含むため、そのSet-Cookie2は拒否されます。
* A Set-Cookie2 from request-host x.foo.com for Domain=.foo.com would be accepted.
* request-hostがx.foo.comで、Domain=.foo.comの場合、そのSet-Cookie2は受け入れられます。
* A Set-Cookie2 with Domain=.com or Domain=.com., will always be rejected, because there is no embedded dot.
* Domain=.comまたはDomain=.com.を指定したSet-Cookie2は、内部ドットがないため、常に拒否されます。
* A Set-Cookie2 with Domain=ajax.com will be accepted, and the value for Domain will be taken to be .ajax.com, because a dot gets prepended to the value.
* Domain=ajax.comを指定したSet-Cookie2は受け入れられます。値の先頭にドットが追加されるため、Domainの値は.ajax.comとして扱われます。
* A Set-Cookie2 with Port="80,8000" will be accepted if the request was made to port 80 or 8000 and will be rejected otherwise.
* Port="80,8000"を指定したSet-Cookie2は、リクエスト先のポートが80または8000であれば受け入れられ、それ以外の場合は拒否されます。
* A Set-Cookie2 from request-host example for Domain=.local will be accepted, because the effective host name for the request-host is example.local, and example.local domain-matches .local.
* request-hostがexampleで、Domain=.localを指定したSet-Cookie2は受け入れられます。request-hostのeffective host nameはexample.localであり、example.localは.localにドメイン一致するためです。
3.3.3 Cookie Management If a user agent receives a Set-Cookie2 response header whose NAME is the same as that of a cookie it has previously stored, the new cookie supersedes the old when: the old and new Domain attribute values compare equal, using a case-insensitive string-compare; and, the old and new Path attribute values string-compare equal (case-sensitive). However, if the Set-Cookie2 has a value for Max-Age of zero, the (old and new) cookie is discarded. Otherwise a cookie persists (resources permitting) until whichever happens first, then gets discarded: its Max-Age lifetime is exceeded; or, if the Discard attribute is set, the user agent terminates the session.
3.3.3 Cookieの管理: ユーザーエージェントが、以前に保存したCookieと同じNAMEを持つSet-Cookie2レスポンスヘッダーを受信した場合、次の条件を満たせば新しいCookieが古いCookieに置き換わります。古いCookieと新しいCookieのDomain属性値が、大文字と小文字を区別しない文字列比較で等しく、かつ両者のPath属性値が、大文字と小文字を区別する文字列比較で等しいことです。ただし、Set-Cookie2のMax-Ageが0の場合は、古いCookieと新しいCookieのどちらも破棄されます。それ以外の場合、Cookieは、次のいずれかが先に起きるまで(リソースが許す限り)保持され、その後破棄されます。Max-Ageで指定した有効期間が過ぎるか、Discard属性が設定されている状態でユーザーエージェントがセッションを終了したときです。
Because user agents have finite space in which to store cookies, they MAY also discard older cookies to make space for newer ones, using, for example, a least-recently-used algorithm, along with constraints on the maximum number of cookies that each origin server may set.
ユーザーエージェントがCookieを保存できる容量には限りがあるため、新しいCookieの保存領域を確保する目的で、たとえば最長未使用(LRU)方式を使い、各オリジンサーバーが設定できるCookie数の上限も考慮しながら、古いCookieを破棄してもかまいません (MAY)。
If a Set-Cookie2 response header includes a Comment attribute, the user agent SHOULD store that information in a human-readable form with the cookie and SHOULD display the comment text as part of a cookie inspection user interface.
Set-Cookie2レスポンスヘッダーにComment属性が含まれる場合、ユーザーエージェントは、その情報をCookieとともに人が読める形式で保存すべきです (SHOULD)。また、Cookieを確認するユーザーインターフェイスの一部としてコメントを表示すべきです (SHOULD)。
If a Set-Cookie2 response header includes a CommentURL attribute, the user agent SHOULD store that information in a human-readable form with the cookie, or, preferably, SHOULD allow the user to follow the http_URL link as part of a cookie inspection user interface.
Set-Cookie2レスポンスヘッダーにCommentURL属性が含まれる場合、ユーザーエージェントは、その情報をCookieとともに人が読める形式で保存すべきです (SHOULD)。さらに望ましい方法として、Cookieを確認するユーザーインターフェイスからユーザーがhttp_URLリンクを開けるようにすべきです (SHOULD)。
The cookie inspection user interface may include a facility whereby a user can decide, at the time the user agent receives the Set-Cookie2 response header, whether or not to accept the cookie. A potentially confusing situation could arise if the following sequence occurs:
Cookie確認用のユーザーインターフェイスには、ユーザーエージェントがSet-Cookie2レスポンスヘッダーを受信した時点で、そのCookieを受け入れるかどうかをユーザーが決める機能を設けることができます。次の一連の動作では、混乱が生じる可能性があります。
* the user agent receives a cookie that contains a CommentURL attribute;
* ユーザーエージェントがCommentURL属性を含むCookieを受信する。
* the user agent's cookie inspection interface is configured so that it presents a dialog to the user before the user agent accepts the cookie;
* ユーザーエージェントは、Cookieを受け入れる前にユーザーへダイアログを表示するよう、Cookie確認用インターフェイスを設定している。
* the dialog allows the user to follow the CommentURL link when the user agent receives the cookie; and,
* そのダイアログから、Cookieを受信したときにユーザーがCommentURLリンクを開ける。
* when the user follows the CommentURL link, the origin server (or another server, via other links in the returned content) returns another cookie.
* ユーザーがCommentURLリンクを開くと、オリジンサーバー(または返されたコンテンツ内の別のリンク先サーバー)が別のCookieを返す。
The user agent SHOULD NOT send any cookies in this context. The user agent MAY discard any cookie it receives in this context that the user has not, through some user agent mechanism, deemed acceptable.
この状況では、ユーザーエージェントはCookieを送信すべきではありません (SHOULD NOT)。また、ユーザーエージェントの何らかの仕組みによってユーザーが受け入れると判断していないCookieを、この状況で受信した場合、破棄してもかまいません (MAY)。
User agents SHOULD allow the user to control cookie destruction, but they MUST NOT extend the cookie's lifetime beyond that controlled by the Discard and Max-Age attributes. An infrequently-used cookie may function as a "preferences file" for network applications, and a user may wish to keep it even if it is the least-recently-used cookie. One possible implementation would be an interface that allows the permanent storage of a cookie through a checkbox (or, conversely, its immediate destruction).
ユーザーエージェントは、Cookieの破棄をユーザーが制御できるようにすべきです (SHOULD)。ただし、Discard属性とMax-Age属性によって定まる期間を超えてCookieの有効期間を延長してはなりません (MUST NOT)。使用頻度の低いCookieがネットワークアプリケーションの「設定ファイル」として機能することがあり、ユーザーは、それが最も長く未使用のCookieであっても保持したい場合があります。実装例として、チェックボックスでCookieを永続的に保存できる(または反対に直ちに破棄できる)インターフェイスが考えられます。
Privacy considerations dictate that the user have considerable control over cookie management. The PRIVACY section contains more information.
プライバシーを考慮すると、ユーザーがCookieの管理を十分に制御できる必要があります。詳しくはPRIVACY節を参照してください。
3.3.4 Sending Cookies to the Origin Server When it sends a request to an origin server, the user agent includes a Cookie request header if it has stored cookies that are applicable to the request, based on
3.3.4 オリジンサーバーへのCookie送信: ユーザーエージェントはオリジンサーバーにリクエストを送る際、保存済みCookieのうち次の条件に基づいてそのリクエストに適用されるものがあれば、Cookieリクエストヘッダーに含めます。
* the request-host and request-port;
* request-hostとrequest-port
* the request-URI;
* request-URI
* the cookie's age.
* Cookieの有効期間
The syntax for the header is:
ヘッダーの構文は次のとおりです。
cookie = "Cookie:" cookie-version 1*((";" | ",") cookie-value)
cookie-value = NAME "=" VALUE [";" path] [";" domain] [";" port]
cookie-version = "$Version" "=" value
NAME = attr
VALUE = value
path = "$Path" "=" value
domain = "$Domain" "=" value
port = "$Port" [ "=" <"> value <"> ]
The value of the cookie-version attribute MUST be the value from the Version attribute of the corresponding Set-Cookie2 response header. Otherwise the value for cookie-version is 0. The value for the path attribute MUST be the value from the Path attribute, if one was present, of the corresponding Set-Cookie2 response header. Otherwise the attribute SHOULD be omitted from the Cookie request header. The value for the domain attribute MUST be the value from the Domain attribute, if one was present, of the corresponding Set-Cookie2 response header. Otherwise the attribute SHOULD be omitted from the Cookie request header.
cookie-version属性の値は、対応するSet-Cookie2レスポンスヘッダーのVersion属性の値でなければなりません (MUST)。それ以外の場合、cookie-versionの値は0です。path属性の値は、対応するSet-Cookie2レスポンスヘッダーにPath属性がある場合、その値でなければなりません (MUST)。Path属性がない場合は、Cookieリクエストヘッダーからpath属性を省略すべきです (SHOULD)。domain属性の値は、対応するSet-Cookie2レスポンスヘッダーにDomain属性がある場合、その値でなければなりません (MUST)。Domain属性がない場合は、Cookieリクエストヘッダーからdomain属性を省略すべきです (SHOULD)。
The port attribute of the Cookie request header MUST mirror the Port attribute, if one was present, in the corresponding Set-Cookie2 response header. That is, the port attribute MUST be present if the Port attribute was present in the Set-Cookie2 header, and it MUST have the same value, if any. Otherwise, if the Port attribute was absent from the Set-Cookie2 header, the attribute likewise MUST be omitted from the Cookie request header.
Cookieリクエストヘッダーのport属性は、対応するSet-Cookie2レスポンスヘッダーにPort属性がある場合、その属性を反映しなければなりません (MUST)。つまり、Set-Cookie2ヘッダーにPort属性がある場合、Cookieリクエストヘッダーにもport属性を含めなければなりません (MUST)。値があれば、その値も同じでなければなりません (MUST)。Set-Cookie2ヘッダーにPort属性がない場合は、Cookieリクエストヘッダーからport属性を省略しなければなりません (MUST)。
Note that there is neither a Comment nor a CommentURL attribute in the Cookie request header corresponding to the ones in the Set-Cookie2 response header. The user agent does not return the comment information to the origin server.
Set-Cookie2レスポンスヘッダーにあるComment属性やCommentURL属性に対応する属性は、Cookieリクエストヘッダーにはありません。ユーザーエージェントはコメント情報をオリジンサーバーに返しません。
The user agent applies the following rules to choose applicable cookie-values to send in Cookie request headers from among all the cookies it has received.
ユーザーエージェントは、受信したすべてのCookieの中からCookieリクエストヘッダーに含めるCookie値を選ぶため、次の規則を適用します。
Domain Selection The origin server's effective host name MUST domain-match the Domain attribute of the cookie.
ドメインの選択: オリジンサーバーのeffective host nameは、CookieのDomain属性にドメイン一致しなければなりません (MUST)。
Port Selection There are three possible behaviors, depending on the Port attribute in the Set-Cookie2 response header:
ポートの選択: Set-Cookie2レスポンスヘッダーのPort属性に応じて、次の3通りの動作になります。
1. By default (no Port attribute), the cookie MAY be sent to any port.
1. 既定では(Port属性がない場合)、Cookieを任意のポートに送信してもかまいません (MAY)。
2. If the attribute is present but has no value (e.g., Port), the cookie MUST only be sent to the request-port it was received from.
2. Port属性があるものの値がない場合(例: Port)、Cookieは受信したときのrequest-portにだけ送信しなければなりません (MUST)。
3. If the attribute has a port-list, the cookie MUST only be returned if the new request-port is one of those listed in port-list.
3. Port属性にport-listがある場合、新しいリクエストのrequest-portがport-listに含まれるときに限り、Cookieを返さなければなりません (MUST)。
Path Selection The request-URI MUST path-match the Path attribute of the cookie.
パスの選択: request-URIは、CookieのPath属性にパスマッチしなければなりません (MUST)。
Max-Age Selection Cookies that have expired should have been discarded and thus are not forwarded to an origin server.
有効期限が切れたCookieは破棄済みであることが前提であり、オリジンサーバーには転送されません。
If multiple cookies satisfy the criteria above, they are ordered in the Cookie header such that those with more specific Path attributes precede those with less specific. Ordering with respect to other attributes (e.g., Domain) is unspecified.
複数のCookieが上記の条件を満たす場合、Cookieヘッダーでは、Path属性がより具体的なCookieを、より具体的でないCookieより前に並べます。他の属性(例: Domain)に基づく順序は規定しません。
Note: For backward compatibility, the separator in the Cookie header is semi-colon (;) everywhere. A server SHOULD also accept comma (,) as the separator between cookie-values for future compatibility.
注: 後方互換性のため、Cookieヘッダー内の区切り文字は常にセミコロン(;)です。将来との互換性のため、サーバーはCookie値の区切り文字としてコンマ(,)も受け入れるべきです (SHOULD)。
3.3.5 Identifying What Version is Understood: Cookie2 The Cookie2 request header facilitates interoperation between clients and servers that understand different versions of the cookie specification. When the client sends one or more cookies to an origin server, if at least one of those cookies contains a $Version attribute whose value is different from the version that the client understands, then the client MUST also send a Cookie2 request header, the syntax for which is
3.3.5 Cookie2: 対応する仕様バージョンの識別: Cookie2リクエストヘッダーは、異なるバージョンのCookie仕様を理解するクライアントとサーバーの相互運用を支援します。クライアントがオリジンサーバーへ1つ以上のCookieを送る際、そのうち少なくとも1つに、クライアントが理解するバージョンとは異なる値の$Version属性が含まれる場合、クライアントはCookie2リクエストヘッダーも送信しなければなりません (MUST)。構文は次のとおりです。
cookie2 = "Cookie2:" cookie-version
cookie2 = "Cookie2:" cookie-version
Here the value for cookie-version is the highest version of cookie specification (currently 1) that the client understands. The client needs to send at most one such request header per request.
ここでcookie-versionの値は、クライアントが理解するCookie仕様のうち最も高いバージョン(現在は1)です。クライアントは、1つのリクエストにつき、この種のリクエストヘッダーを最大1つ送信します。
3.3.6 Sending Cookies in Unverifiable Transactions Users MUST have control over sessions in order to ensure privacy. (See PRIVACY section below.) To simplify implementation and to prevent an additional layer of complexity where adequate safeguards exist, however, this document distinguishes between transactions that are verifiable and those that are unverifiable. A transaction is verifiable if the user, or a user-designated agent, has the option to review the request-URI prior to its use in the transaction. A transaction is unverifiable if the user does not have that option. Unverifiable transactions typically arise when a user agent automatically requests inlined or embedded entities or when it resolves redirection (3xx) responses from an origin server. Typically the origin transaction, the transaction that the user initiates, is verifiable, and that transaction may directly or indirectly induce the user agent to make unverifiable transactions.
3.3.6 検証不可能なトランザクションでのCookieの送信 プライバシーを確保するために、ユーザーはセッションを制御できなければなりません (MUST)。(後述のPRIVACYセクションを参照してください。)ただし、実装を簡単にし、十分な安全策が存在する場合に余計な複雑さを持ち込まないように、この文書では検証可能なトランザクションと検証不可能なトランザクションを区別します。ユーザー、またはユーザーが指定したエージェントが、トランザクションで使用される前にRequest-URIを確認する選択肢を持っている場合、そのトランザクションは検証可能です。ユーザーがその選択肢を持たない場合、トランザクションは検証不可能です。検証不可能なトランザクションは、通常、ユーザーエージェントがインラインまたは埋め込みのエンティティを自動的に要求する場合や、オリジンサーバーからのリダイレクト(3xx)応答を処理する場合に発生します。通常、元のトランザクション、つまりユーザーが開始するトランザクションは検証可能であり、そのトランザクションが直接的または間接的にユーザーエージェントに検証不可能なトランザクションを行わせることがあります。
An unverifiable transaction is to a third-party host if its request-host U does not domain-match the reach R of the request-host O in the origin transaction.
検証不可能なトランザクションのrequest-hostをU、元のトランザクションのrequest-hostをO、その到達範囲をRとします。UがRにドメイン一致しない場合、その検証不可能なトランザクションはサードパーティーホストに対するものです。
When it makes an unverifiable transaction, a user agent MUST disable all cookie processing (i.e., MUST NOT send cookies, and MUST NOT accept any received cookies) if the transaction is to a third-party host.
検証不可能なトランザクションを作成する場合、ユーザーエージェントはすべてのCookie処理を無効にしなければなりません (MUST)(つまり、Cookieを送信してはなりません (MUST NOT)し、受け取ったCookieを受け入れてはなりません (MUST NOT))。
This restriction prevents a malicious service author from using unverifiable transactions to induce a user agent to start or continue a session with a server in a different domain. The starting or continuation of such sessions could be contrary to the privacy expectations of the user, and could also be a security problem.
この制限は、悪意あるサービス作成者が検証不可能なトランザクションを利用して、ユーザーエージェントに別ドメインのサーバーとのセッションを開始または継続させることを防ぎます。このようなセッションの開始や継続は、ユーザーのプライバシーに関する期待に反する可能性があり、セキュリティ上の問題にもなり得ます。
User agents MAY offer configurable options that allow the user agent, or any autonomous programs that the user agent executes, to ignore the above rule, so long as these override options default to "off".
ユーザーエージェントは、上記の規則を無視できる設定項目を提供してもかまいません (MAY)。この設定はユーザーエージェント自体、またはユーザーエージェントが実行する自律プログラムに適用できますが、上書き設定の既定値は"off"でなければなりません。
(N.B. Mechanisms may be proposed that will automate overriding the third-party restrictions under controlled conditions.)
(注: 管理された条件下でサードパーティー制限を自動的に上書きする仕組みが提案される可能性があります。)
Many current user agents already provide a review option that would render many links verifiable. For instance, some user agents display the URL that would be referenced for a particular link when the mouse pointer is placed over that link. The user can therefore determine whether to visit that site before causing the browser to do so. (Though not implemented on current user agents, a similar technique could be used for a button used to submit a form -- the user agent could display the action to be taken if the user were to select that button.) However, even this would not make all links verifiable; for example, links to automatically loaded images would not normally be subject to "mouse pointer" verification.
現在、多くのユーザーエージェントには、リンク先を確認可能にする機能がすでにあります。たとえば、リンクにマウスポインターを重ねると、そのリンクが参照するURLを表示するユーザーエージェントがあります。そのためユーザーは、ブラウザーにアクセスさせる前に、そのサイトを訪問するかどうかを判断できます(現在のユーザーエージェントには実装されていませんが、フォーム送信ボタンにも同様の方法を使えます。ユーザーがボタンを選んだ場合に実行される操作をユーザーエージェントが表示できます)。ただし、この方法ですべてのリンクを確認できるわけではありません。たとえば、自動的に読み込まれる画像へのリンクは、通常「マウスポインター」による確認の対象になりません。
Many user agents also provide the option for a user to view the HTML source of a document, or to save the source to an external file where it can be viewed by another application. While such an option does provide a crude review mechanism, some users might not consider it acceptable for this purpose.
多くのユーザーエージェントは、文書のHTMLソースを表示したり、別のアプリケーションで表示できるようソースを外部ファイルに保存したりする機能も備えています。この機能は簡易的な確認手段にはなりますが、この目的に十分だと考えないユーザーもいるでしょう。
A user agent returns much of the information in the Set-Cookie2 header to the origin server when the request-URI path-matches the Path attribute of the cookie. When it receives a Cookie header, the origin server SHOULD treat cookies with NAMEs whose prefix is $ specially, as an attribute for the cookie.
ユーザーエージェントは、CookieのPath属性にrequest-URIがパスマッチすると、Set-Cookie2ヘッダーの情報の多くをオリジンサーバーに返します。Cookieヘッダーを受信したオリジンサーバーは、NAMEが$で始まるCookieを、そのCookieの属性として特別に扱うべきです (SHOULD)。
One reason for separating state information from both a URL and document content is to facilitate the scaling that caching permits. To support cookies, a caching proxy MUST obey these rules already in the HTTP specification:
状態情報をURLや文書内容から分離する理由の1つは、キャッシュによる拡張性を高めることです。Cookieをサポートするキャッシュプロキシは、HTTP仕様にすでに定められている次の規則に従わなければなりません (MUST)。
* Honor requests from the cache, if possible, based on cache validity rules.
* キャッシュの有効性に関する規則に基づき、可能であればリクエストにキャッシュから応答する。
* Pass along a Cookie request header in any request that the proxy must make of another server.
* プロキシが別のサーバーに送るすべてのリクエストに、Cookieリクエストヘッダーを引き継ぐ。
* Return the response to the client. Include any Set-Cookie2 response header.
* Set-Cookie2レスポンスヘッダーを含め、レスポンスをクライアントに返す。
* Cache the received response subject to the control of the usual headers, such as Expires,
* Expiresなどの通常のヘッダーによる制御に従って、受信したレスポンスをキャッシュします。
Cache-control: no-cache
Cache-control: no-cache
and
および
Cache-control: private
Cache-control: private
* Cache the Set-Cookie2 subject to the control of the usual header,
* 通常のヘッダーによる制御に従って、Set-Cookie2をキャッシュします。
Cache-control: no-cache="set-cookie2"
Cache-control: no-cache="set-cookie2"
(The Set-Cookie2 header should usually not be cached.)
(通常、Set-Cookie2ヘッダーはキャッシュしないほうがよいです。)
Proxies MUST NOT introduce Set-Cookie2 (Cookie) headers of their own in proxy responses (requests).
プロキシは、自身のSet-Cookie2(Cookie)ヘッダーをプロキシレスポンス(リクエスト)に追加してはなりません (MUST NOT)。
Most detail of request and response headers has been omitted. Assume the user agent has no stored cookies.
リクエストとレスポンスのヘッダーの詳細の大半は省略しています。ユーザーエージェントにはCookieが保存されていないものとします。
1. User Agent -> Server
1. User Agent -> Server
POST /acme/login HTTP/1.1 [form data]
POST /acme/login HTTP/1.1 [form data]
User identifies self via a form.
ユーザーがフォームで自分を識別します。
2. Server -> User Agent
2. Server -> User Agent
HTTP/1.1 200 OK
Set-Cookie2: Customer="WILE_E_COYOTE"; Version="1"; Path="/acme"
Cookie reflects user's identity.
Cookieはユーザーの識別情報を表します。
3. User Agent -> Server
3. User Agent -> Server
POST /acme/pickitem HTTP/1.1
Cookie: $Version="1"; Customer="WILE_E_COYOTE"; $Path="/acme"
[form data]
User selects an item for "shopping basket".
ユーザーが「ショッピングバスケット」に入れる商品を選びます。
4. Server -> User Agent
4. Server -> User Agent
HTTP/1.1 200 OK
Set-Cookie2: Part_Number="Rocket_Launcher_0001"; Version="1";
Path="/acme"
Shopping basket contains an item.
ショッピングバスケットに商品が追加されます。
5. User Agent -> Server
5. User Agent -> Server
POST /acme/shipping HTTP/1.1
Cookie: $Version="1";
Customer="WILE_E_COYOTE"; $Path="/acme";
Part_Number="Rocket_Launcher_0001"; $Path="/acme"
[form data]
User selects shipping method from form.
ユーザーがフォームで配送方法を選びます。
6. Server -> User Agent
6. Server -> User Agent
HTTP/1.1 200 OK
Set-Cookie2: Shipping="FedEx"; Version="1"; Path="/acme"
New cookie reflects shipping method.
新しいCookieは配送方法を表します。
7. User Agent -> Server
7. User Agent -> Server
POST /acme/process HTTP/1.1
Cookie: $Version="1";
Customer="WILE_E_COYOTE"; $Path="/acme";
Part_Number="Rocket_Launcher_0001"; $Path="/acme";
Shipping="FedEx"; $Path="/acme"
[form data]
User chooses to process order.
8. Server -> User Agent
8. Server -> User Agent
HTTP/1.1 200 OK
HTTP/1.1 200 OK
Transaction is complete.
トランザクションが完了します。
The user agent makes a series of requests on the origin server, after each of which it receives a new cookie. All the cookies have the same Path attribute and (default) domain. Because the request-URIs all path-match /acme, the Path attribute of each cookie, each request contains all the cookies received so far.
ユーザーエージェントはオリジンサーバーに一連のリクエストを送り、それぞれのレスポンスで新しいCookieを受け取ります。Cookieはすべて同じPath属性と(既定の)Domain属性を持ちます。すべてのrequest-URIが各CookieのPath属性 /acme にパスマッチするため、各リクエストには、それまでに受け取ったすべてのCookieが含まれます。
This example illustrates the effect of the Path attribute. All detail of request and response headers has been omitted. Assume the user agent has no stored cookies.
この例はPath属性の効果を示します。リクエストヘッダーとレスポンスヘッダーの詳細はすべて省略しています。ユーザーエージェントにはCookieが保存されていないものとします。
Imagine the user agent has received, in response to earlier requests, the response headers
ユーザーエージェントが以前のリクエストへの応答として、次のレスポンスヘッダーを受信したとします。
Set-Cookie2: Part_Number="Rocket_Launcher_0001"; Version="1";
Path="/acme"
and
および
Set-Cookie2: Part_Number="Riding_Rocket_0023"; Version="1";
Path="/acme/ammo"
A subsequent request by the user agent to the (same) server for URLs of the form /acme/ammo/... would include the following request header:
ユーザーエージェントが同じサーバーに対して、/acme/ammo/...の形式のURLをリクエストすると、次のリクエストヘッダーが含まれます。
Cookie: $Version="1";
Part_Number="Riding_Rocket_0023"; $Path="/acme/ammo";
Part_Number="Rocket_Launcher_0001"; $Path="/acme"
Note that the NAME=VALUE pair for the cookie with the more specific Path attribute, /acme/ammo, comes before the one with the less specific Path attribute, /acme. Further note that the same cookie name appears more than once.
Path属性がより具体的なCookie(/acme/ammo)のNAME=VALUEの組は、Path属性がより具体的でないCookie(/acme)のNAME=VALUEの組より先に来ます。同じCookie名が複数回現れる点にも注意してください。
A subsequent request by the user agent to the (same) server for a URL
of the form /acme/parts/ would include the following request header:
Cookie: $Version="1"; Part_Number="Rocket_Launcher_0001";
$Path="/acme"
Here, the second cookie's Path attribute /acme/ammo is not a prefix of the request URL, /acme/parts/, so the cookie does not get forwarded to the server.
2番目のCookieのPath属性 /acme/ammoは、リクエストURL /acme/parts/の接頭辞ではありません。そのため、そのCookieはサーバーに転送されません。
Here we provide guidance on likely or desirable details for an origin server that implements state management.
ここでは、状態管理を実装するオリジンサーバー向けに、想定される詳細や望ましい実装についてガイダンスを示します。
An origin server's content should probably be divided into disjoint application areas, some of which require the use of state information. The application areas can be distinguished by their request URLs. The Set-Cookie2 header can incorporate information about the application areas by setting the Path attribute for each one.
オリジンサーバーのコンテンツは、おそらく互いに重ならないアプリケーション領域に分割するのがよいでしょう。その一部では状態情報が必要になります。アプリケーション領域はリクエストURLによって区別できます。Set-Cookie2ヘッダーでは、各アプリケーション領域にPath属性を設定して、その領域に関する情報を指定できます。
The session information can obviously be clear or encoded text that describes state. However, if it grows too large, it can become unwieldy. Therefore, an implementor might choose for the session information to be a key to a server-side resource. Of course, using a database creates some problems that this state management specification was meant to avoid, namely:
セッション情報は、状態を表す平文または符号化テキストにできます。ただし、情報が大きくなりすぎると扱いにくくなります。そのため実装者は、セッション情報をサーバー側リソースのキーにすることを選ぶ場合があります。もちろん、データベースを使うと、この状態管理仕様が避けようとしていた次の問題が生じます。
1. keeping real state on the server side;
1. サーバー側で実際の状態を保持すること。
2. how and when to garbage-collect the database entry, in case the user agent terminates the session by, for example, exiting.
2. たとえばユーザーエージェントの終了によってセッションが終わった場合に、データベースのエントリーをどのように、いつ削除するか。
Caching benefits the scalability of WWW. Therefore it is important to reduce the number of documents that have state embedded in them inherently. For example, if a shopping-basket-style application always displays a user's current basket contents on each page, those pages cannot be cached, because each user's basket's contents would be different. On the other hand, if each page contains just a link that allows the user to "Look at My Shopping Basket", the page can be cached.
キャッシュはWWWの拡張性を高めます。そのため、状態が文書自体に埋め込まれている文書の数を減らすことが重要です。たとえば、ショッピングバスケット型のアプリケーションが各ページにユーザーの現在のバスケット内容を表示する場合、ユーザーごとに内容が異なるため、そのページはキャッシュできません。一方、各ページに「ショッピングバスケットを見る」ためのリンクだけを置けば、そのページをキャッシュできます。
Practical user agent implementations have limits on the number and size of cookies that they can store. In general, user agents' cookie support should have no fixed limits. They should strive to store as many frequently-used cookies as possible. Furthermore, general-use user agents SHOULD provide each of the following minimum capabilities individually, although not necessarily simultaneously:
実用上、ユーザーエージェントの実装には、保存できるCookieの数やサイズに制限があります。一般に、ユーザーエージェントのCookie対応には固定上限を設けないことが望ましいです。頻繁に使われるCookieをできるだけ多く保存するよう努めることが望ましいです。さらに、汎用ユーザーエージェントは、同時に提供する必要はありませんが、次の能力をそれぞれ最低限提供すべきです (SHOULD):
* at least 300 cookies
* Cookieを少なくとも300個保存できること
* at least 4096 bytes per cookie (as measured by the characters that comprise the cookie non-terminal in the syntax description of the Set-Cookie2 header, and as received in the Set-Cookie2 header)
* Cookie 1個につき少なくとも4096バイトを扱えること(Set-Cookie2ヘッダーの構文でCookie非終端記号を構成する文字数に基づき、Set-Cookie2ヘッダーで受信した内容を測定します)
* at least 20 cookies per unique host or domain name
* 一意のホスト名またはドメイン名ごとに、Cookieを少なくとも20個保存できること
User agents created for specific purposes or for limited-capacity devices SHOULD provide at least 20 cookies of 4096 bytes, to ensure that the user can interact with a session-based origin server.
特定用途向け、または容量が限られた機器向けのユーザーエージェントは、ユーザーがセッションベースのオリジンサーバーを利用できるよう、4096バイトのCookieを少なくとも20個提供すべきです (SHOULD)。
The information in a Set-Cookie2 response header MUST be retained in its entirety. If for some reason there is inadequate space to store the cookie, it MUST be discarded, not truncated.
Set-Cookie2レスポンスヘッダーの情報は、全体をそのまま保持しなければなりません (MUST)。何らかの理由でCookieを保存する容量が足りない場合、内容を切り詰めずにCookie全体を破棄しなければなりません (MUST)。
Applications should use as few and as small cookies as possible, and they should cope gracefully with the loss of a cookie.
アプリケーションでは、できるだけ少数かつ小さいCookieを使い、Cookieが失われても適切に動作できるようにすることが望ましいです。
5.3.1 Denial of Service Attacks User agents MAY choose to set an upper bound on the number of cookies to be stored from a given host or domain name or on the size of the cookie information. Otherwise a malicious server could attempt to flood a user agent with many cookies, or large cookies, on successive responses, which would force out cookies the user agent had received from other servers. However, the minima specified above SHOULD still be supported.
5.3.1 サービス妨害攻撃: ユーザーエージェントは、特定のホスト名またはドメイン名から保存するCookieの数や、Cookie情報のサイズに上限を設けてもかまいません (MAY)。上限がなければ、悪意のあるサーバーが連続するレスポンスで大量または巨大なCookieを送り、ユーザーエージェントに保存された他のサーバー由来のCookieを押し出すおそれがあります。ただし、前述の最小能力は引き続きサポートすべきです (SHOULD)。
Informed consent should guide the design of systems that use cookies. A user should be able to find out how a web site plans to use information in a cookie and should be able to choose whether or not those policies are acceptable. Both the user agent and the origin server must assist informed consent.
Cookieを使うシステムは、ユーザーが内容を理解して同意できることを基本に設計するのが望ましいです。WebサイトがCookie内の情報をどのように使う予定かをユーザーが確認でき、その方針を受け入れるかどうか選べるようにすることが望ましいです。ユーザーエージェントとオリジンサーバーの双方が、十分な説明に基づく同意を支援する必要があります。
An origin server could create a Set-Cookie2 header to track the path of a user through the server. Users may object to this behavior as an intrusive accumulation of information, even if their identity is not evident. (Identity might become evident, for example, if a user subsequently fills out a form that contains identifying information.) This state management specification therefore requires that a user agent give the user control over such a possible intrusion, although the interface through which the user is given this control is left unspecified. However, the control mechanisms provided SHALL at least allow the user
オリジンサーバーは、ユーザーがサーバー内をどのように移動したか追跡するためにSet-Cookie2ヘッダーを作成することがあります。本人が特定されていなくても、情報が侵入的に蓄積されることにユーザーが反対する場合があります(たとえば、後にユーザーが個人を特定する情報を含むフォームに入力すると、本人が判明することがあります)。そのため、この状態管理仕様では、ユーザーエージェントがこうした侵入の可能性をユーザー自身で制御できるように求めています。ただし、制御用インターフェイスの形式は規定しません。提供する制御機構では、少なくともユーザーが次の操作を行えるようにしなければなりません (SHALL):
* to completely disable the sending and saving of cookies.
* Cookieの送信と保存を完全に無効にする。
* to determine whether a stateful session is in progress.
* 状態を保持するセッションが進行中かどうかを確認する。
* to control the saving of a cookie on the basis of the cookie's Domain attribute.
* CookieのDomain属性に基づいて、そのCookieを保存するかどうかを制御する。
Such control could be provided, for example, by mechanisms
たとえば、次のような仕組みで制御を提供できます。
* to notify the user when the user agent is about to send a cookie to the origin server, to offer the option not to begin a session.
* ユーザーエージェントがCookieをオリジンサーバーに送信する直前にユーザーへ通知し、セッションを開始しない選択肢を提示する。
* to display a visual indication that a stateful session is in progress.
* 状態を保持するセッションが進行中であることを視覚的に示す。
* to let the user decide which cookies, if any, should be saved when the user concludes a window or user agent session.
* ウィンドウまたはユーザーエージェントのセッションを終了するときに、どのCookieを保存するか(保存しないか)をユーザーが選べるようにする。
* to let the user examine and delete the contents of a cookie at any time.
* ユーザーがいつでもCookieの内容を確認し、削除できるようにする。
A user agent usually begins execution with no remembered state information. It SHOULD be possible to configure a user agent never to send Cookie headers, in which case it can never sustain state with an origin server. (The user agent would then behave like one that is unaware of how to handle Set-Cookie2 response headers.)
通常、ユーザーエージェントは、記憶された状態情報がない状態で実行を開始します。Cookieヘッダーを一切送信しないようユーザーエージェントを設定できるべきです (SHOULD)。その場合、オリジンサーバーとの状態を保持できません(ユーザーエージェントは、Set-Cookie2レスポンスヘッダーの処理方法を知らないものと同じように動作します)。
When the user agent terminates execution, it SHOULD let the user discard all state information. Alternatively, the user agent MAY ask the user whether state information should be retained; the default should be "no". If the user chooses to retain state information, it would be restored the next time the user agent runs.
ユーザーエージェントは、実行を終了するときに、すべての状態情報を破棄する選択肢をユーザーに与えるべきです (SHOULD)。別の方法として、状態情報を保持するかどうかをユーザーに尋ねてもかまいません (MAY)。既定では「いいえ」を選ぶのが望ましいです。ユーザーが状態情報を保持すると選んだ場合、次回ユーザーエージェントを実行したときにその情報を復元します。
NOTE: User agents should probably be cautious about using files to store cookies long-term. If a user runs more than one instance of the user agent, the cookies could be commingled or otherwise corrupted.
注: ユーザーエージェントは、Cookieを長期間ファイルに保存する場合には慎重を期すのがよいでしょう。ユーザーがユーザーエージェントを複数起動すると、Cookieが混在したり、その他の形で破損したりする可能性があります。
An origin server SHOULD promote informed consent by adding CommentURL or Comment information to the cookies it sends. CommentURL is preferred because of the opportunity to provide richer information in a multiplicity of languages.
オリジンサーバーは、送信するCookieにCommentURLまたはCommentの情報を追加し、ユーザーが説明を読んで同意できるようにすべきです (SHOULD)。複数の言語でより詳しい情報を提供できるため、CommentよりCommentURLが望ましいです。
The information in the Set-Cookie2 and Cookie headers is unprotected. As a consequence:
Set-Cookie2ヘッダーとCookieヘッダーの情報は保護されていません。そのため、次の問題があります。
1. Any sensitive information that is conveyed in them is exposed to intruders.
1. それらに伝えられる機密情報は、侵入者にさらされます。
2. A malicious intermediary could alter the headers as they travel in either direction, with unpredictable results.
2. 悪意のある中継者が、いずれかの方向への伝送中にヘッダーを書き換え、予測できない結果を引き起こす可能性があります。
These facts imply that information of a personal and/or financial nature should only be sent over a secure channel. For less sensitive information, or when the content of the header is a database key, an origin server should be vigilant to prevent a bad Cookie value from causing failures.
このため、個人情報や金銭に関する情報は、安全なチャネルでのみ送信するのが望ましいです。機密性の低い情報を扱う場合や、ヘッダーの内容がデータベースキーである場合も、オリジンサーバーは不正なCookie値による障害を防ぐよう注意するのが望ましいです。
A user agent in a shared user environment poses a further risk. Using a cookie inspection interface, User B could examine the contents of cookies that were saved when User A used the machine.
共有されたユーザー環境のユーザーエージェントは、さらなるリスクをもたらします。クッキー検査インターフェイスを使用して、ユーザーBは、ユーザーAがマシンを使用したときに保存されたCookieの内容を調べることができます。
The restrictions on the value of the Domain attribute, and the rules concerning unverifiable transactions, are meant to reduce the ways that cookies can "leak" to the "wrong" site. The intent is to restrict cookies to one host, or a closely related set of hosts. Therefore a request-host is limited as to what values it can set for Domain. We consider it acceptable for hosts host1.foo.com and host2.foo.com to share cookies, but not a.com and b.com.
Domain属性に設定できる値の制限と、検証不可能なトランザクションに関する規則は、Cookieが「誤った」サイトに「漏れる」可能性を減らすためのものです。Cookieを1つのホスト、または密接に関連するホスト群に限定することを意図しています。そのため、request-hostがDomain属性に設定できる値を制限しています。host1.foo.comとhost2.foo.comがCookieを共有するのは許容できますが、a.comとb.comが共有するのは許容できません。
Similarly, a server can set a Path only for cookies that are related to the request-URI.
同様に、サーバーがPath属性に設定できるのは、request-URIに関連するパスだけです。
Proper application design can avoid spoofing attacks from related domains. Consider:
適切なアプリケーション設計によって、関連ドメインからのなりすまし攻撃を防げます。次の例を考えてください。
1. User agent makes request to victim.cracker.edu, gets back cookie session_id="1234" and sets the default domain victim.cracker.edu.
1. ユーザーエージェントがvictim.cracker.eduにリクエストを送り、Cookie session_id="1234"を受け取ります。Domainの既定値はvictim.cracker.eduです。
2. User agent makes request to spoof.cracker.edu, gets back cookie session-id="1111", with Domain=".cracker.edu".
2. ユーザーエージェントがspoof.cracker.eduにリクエストを送り、Domain=".cracker.edu"が指定されたCookie session-id="1111"を受け取ります。
3. User agent makes request to victim.cracker.edu again, and passes
3. ユーザーエージェントが再びvictim.cracker.eduにリクエストを送り、次のヘッダーを送信します。
Cookie: $Version="1"; session_id="1234",
$Version="1"; session_id="1111"; $Domain=".cracker.edu"
The server at victim.cracker.edu should detect that the second cookie was not one it originated by noticing that the Domain attribute is not for itself and ignore it.
victim.cracker.eduのサーバーは、2番目のCookieのDomain属性が自身のドメインを指していないことから、そのCookieが自ら発行したものではないと判断し、無視するのがよいでしょう。
A user agent SHOULD make every attempt to prevent the sharing of session information between hosts that are in different domains. Embedded or inlined objects may cause particularly severe privacy problems if they can be used to share cookies between disparate hosts. For example, a malicious server could embed cookie information for host a.com in a URI for a CGI on host b.com. User agent implementors are strongly encouraged to prevent this sort of exchange whenever possible.
ユーザーエージェントは、異なるドメインにあるホスト間のセッション情報の共有を防ぐためにあらゆる試みを行うべきです (SHOULD)。埋め込まれたオブジェクトまたはインラインされたオブジェクトは、異なるホスト間でCookieを共有するために使用できる場合、特に深刻なプライバシーの問題を引き起こす可能性があります。たとえば、悪意のあるサーバーは、ホストB.comのCGI用のURIにホストA.comのCookie情報を埋め込むことができます。ユーザーエージェントの実装者は、可能な限りこの種の交換を防ぐことを強くお勧めします。
While it is common practice to use them this way, cookies are not designed or intended to be used to hold authentication information, such as account names and passwords. Unless such cookies are exchanged over an encrypted path, the account information they contain is highly vulnerable to perusal and theft.
この方法で使用することは一般的な慣行ですが、Cookieは、アカウント名やパスワードなどの認証情報を保持するために設計または使用することを意図していません。そのようなCookieが暗号化されたパスで交換されない限り、それらに含まれるアカウント情報は、閲覧や盗難に対して非常に脆弱です。
Apart from RFC 2109, three other proposals have been made to accomplish similar goals. This specification began as an amalgam of Kristol's State-Info proposal [DMK95] and Netscape's Cookie proposal [Netscape].
RFC 2109のほかにも、同様の目的を達成するための提案が3件ありました。この仕様は、KristolのState-Info提案[DMK95]とNetscapeのCookie提案[Netscape]を組み合わせたものとして始まりました。
Brian Behlendorf proposed a Session-ID header that would be user-agent-initiated and could be used by an origin server to track "clicktrails". It would not carry any origin-server-defined state, however. Phillip Hallam-Baker has proposed another client-defined session ID mechanism for similar purposes.
Brian Behlendorfは、ユーザーエージェントが開始し、オリジンサーバーが「クリック履歴」を追跡するために使えるSession-IDヘッダーを提案しました。ただし、このヘッダーはオリジンサーバーが定義する状態情報を運びません。同様の目的で、Phillip Hallam-Bakerもクライアント定義のセッションID機構を提案しています。
While both session IDs and cookies can provide a way to sustain stateful sessions, their intended purpose is different, and, consequently, the privacy requirements for them are different. A user initiates session IDs to allow servers to track progress through them, or to distinguish multiple users on a shared machine. Cookies are server-initiated, so the cookie mechanism described here gives users control over something that would otherwise take place without the users' awareness. Furthermore, cookies convey rich, server-selected information, whereas session IDs comprise user-selected, simple information.
セッションIDもCookieも状態を保持するセッションを維持できますが、目的が異なるため、プライバシー要件も異なります。セッションIDは、サーバーがユーザーの操作の流れを追跡できるように、または共有端末上の複数のユーザーを区別できるように、ユーザーが開始します。Cookieはサーバーが開始します。そのため、ここで説明するCookie機構により、ユーザーが知らないうちに行われる処理をユーザー自身が制御できます。さらに、Cookieはサーバーが選んだ豊富な情報を伝える一方、セッションIDはユーザーが選んだ単純な情報で構成されます。
Existing cookie implementations, based on the Netscape specification, use the Set-Cookie (not Set-Cookie2) header. User agents that receive in the same response both a Set-Cookie and Set-Cookie2 response header for the same cookie MUST discard the Set-Cookie information and use only the Set-Cookie2 information. Furthermore, a user agent MUST assume, if it received a Set-Cookie2 response header, that the sending server complies with this document and will understand Cookie request headers that also follow this specification.
Netscape仕様に基づく既存のCookie実装は、Set-Cookieヘッダー(Set-Cookie2ではありません)を使います。同じCookieについてSet-CookieとSet-Cookie2の両方を同一レスポンスで受信したユーザーエージェントは、Set-Cookieの情報を破棄し、Set-Cookie2の情報だけを使わなければなりません (MUST)。さらにユーザーエージェントは、Set-Cookie2レスポンスヘッダーを受信した場合、送信元サーバーがこの文書に準拠しており、この仕様に従うCookieリクエストヘッダーを理解すると想定しなければなりません (MUST)。
New cookies MUST replace both equivalent old- and new-style cookies. That is, if a user agent that follows both this specification and Netscape's original specification receives a Set-Cookie2 response header, and the NAME and the Domain and Path attributes match (per the Cookie Management section) a Netscape-style cookie, the Netscape-style cookie MUST be discarded, and the user agent MUST retain only the cookie adhering to this specification.
新しいCookieは、同等の旧形式と新形式のCookieの両方を置き換えなければなりません (MUST)。つまり、この仕様とNetscapeの初期仕様の両方に対応するユーザーエージェントがSet-Cookie2レスポンスヘッダーを受信し、そのNAME、Domain属性、Path属性がCookie管理節に従ってNetscape形式のCookieと一致する場合、Netscape形式のCookieを破棄しなければなりません (MUST)。また、この仕様に準拠するCookieだけを保持しなければなりません (MUST)。
Older user agents that do not understand this specification, but that do understand Netscape's original specification, will not recognize the Set-Cookie2 response header and will receive and send cookies according to the older specification.
この仕様には対応しないもののNetscapeの初期仕様には対応する古いユーザーエージェントは、Set-Cookie2レスポンスヘッダーを認識しません。そのため、古い仕様に従ってCookieを受信し、送信します。
A user agent that supports both this specification and Netscape-style cookies SHOULD send a Cookie request header that follows the older Netscape specification if it received the cookie in a Set-Cookie response header and not in a Set-Cookie2 response header. However, it SHOULD send the following request header as well:
この仕様とNetscape形式のCookieの両方に対応するユーザーエージェントは、Set-Cookie2ではなくSet-CookieレスポンスヘッダーでCookieを受信した場合、古いNetscape仕様に従うCookieリクエストヘッダーを送信すべきです (SHOULD)。ただし、次のリクエストヘッダーも送信すべきです (SHOULD)。
Cookie2: $Version="1"
Cookie2: $Version="1"
The Cookie2 header advises the server that the user agent understands new-style cookies. If the server understands new-style cookies, as well, it SHOULD continue the stateful session by sending a Set-Cookie2 response header, rather than Set-Cookie. A server that does not understand new-style cookies will simply ignore the Cookie2 request header.
Cookie2ヘッダーは、新形式のCookieにも対応していることをサーバーに知らせます。サーバーも新形式のCookieに対応している場合、Set-CookieではなくSet-Cookie2レスポンスヘッダーを送信して状態保持セッションを継続すべきです (SHOULD)。新形式のCookieに対応していないサーバーは、Cookie2リクエストヘッダーをそのまま無視します。
Some caches, such as those conforming to HTTP/1.0, will inevitably cache the Set-Cookie2 and Set-Cookie headers, because there was no mechanism to suppress caching of headers prior to HTTP/1.1. This caching can lead to security problems. Documents transmitted by an origin server along with Set-Cookie2 and Set-Cookie headers usually either will be uncachable, or will be "pre-expired". As long as caches obey instructions not to cache documents (following Expires: <a date in the past> or Pragma: no-cache (HTTP/1.0), or Cache-control: no-cache (HTTP/1.1)) uncachable documents present no problem. However, pre-expired documents may be stored in caches. They require validation (a conditional GET) on each new request, but some cache operators loosen the rules for their caches, and sometimes serve expired documents without first validating them. This combination of factors can lead to cookies meant for one user later being sent to another user. The Set-Cookie2 and Set-Cookie headers are stored in the cache, and, although the document is stale (expired), the cache returns the document in response to later requests, including cached headers.
HTTP/1.0に準拠するキャッシュなど、一部のキャッシュは、HTTP/1.1より前にはヘッダーのキャッシュを抑制する仕組みがなかったため、Set-Cookie2ヘッダーとSet-Cookieヘッダーを必然的にキャッシュします。このキャッシュによってセキュリティ上の問題が生じる可能性があります。オリジンサーバーがSet-Cookie2ヘッダーやSet-Cookieヘッダーとともに送信する文書は、通常、キャッシュ不可にするか、"pre-expired"状態にします。キャッシュ不可の文書は、キャッシュが文書を保存しないようにという指示(Expires: <a date in the past>、Pragma: no-cache(HTTP/1.0)、またはCache-control: no-cache(HTTP/1.1))に従う限り、問題を起こしません。ただし、"pre-expired"の文書はキャッシュに保存されることがあります。その場合、新しいリクエストごとに検証(条件付きGET)が必要ですが、一部のキャッシュ運用者はキャッシュの規則を緩め、検証せずに期限切れの文書を返すことがあります。これらの要因が重なると、あるユーザー向けのCookieが後に別のユーザーへ送信される可能性があります。Set-Cookie2ヘッダーとSet-Cookieヘッダーがキャッシュに保存されていると、文書が古くなっていても(期限切れでも)、キャッシュが後続のリクエストに対して、キャッシュ済みヘッダーを含む文書を返すことになるためです。
This document really represents the collective efforts of the HTTP Working Group of the IETF and, particularly, the following people, in addition to the authors: Roy Fielding, Yaron Goland, Marc Hedlund, Ted Hardie, Koen Holtman, Shel Kaphan, Rohit Khare, Foteos Macrides, David W. Morris.
この文書はIETFのHTTPワーキンググループ全体の取り組みの成果であり、特に著者に加えて、次の方々が貢献しました: Roy Fielding, Yaron Goland, Marc Hedlund, Ted Hardie, Koen Holtman, Shel Kaphan, Rohit Khare, Foteos Macrides, David W. Morris.
David M. Kristol Bell Laboratories, Lucent Technologies 600 Mountain Ave. Room 2A-333 Murray Hill, NJ 07974
David M. Kristol Bell Laboratories, Lucent Technologies 600 Mountain Ave. Room 2A-333 Murray Hill, NJ 07974
Phone: (908) 582-2250 Fax: (908) 582-1239 EMail: dmk@bell-labs.com
Phone: (908) 582-2250 Fax: (908) 582-1239 EMail: dmk@bell-labs.com
Lou Montulli Epinions.com, Inc. 2037 Landings Dr. Mountain View, CA 94301
Lou Montulli Epinions.com, Inc. 2037 Landings Dr. Mountain View, CA 94301
EMail: lou@montulli.org
[DMK95] Kristol, D.M., "Proposed HTTP State-Info Mechanism", available at <http://portal.research.bell-labs.com/~dmk/state-info.html>, September, 1995.
[DMK95] Kristol, D.M., "Proposed HTTP State-Info Mechanism", available at <http://portal.research.bell-labs.com/~dmk/state-info.html>, September, 1995.
[Netscape] "Persistent Client State -- HTTP Cookies", available at <http://www.netscape.com/newsref/std/cookie_spec.html>, undated.
[Netscape] "Persistent Client State -- HTTP Cookies", available at <http://www.netscape.com/newsref/std/cookie_spec.html>, undated.
[RFC2109] Kristol, D. and L. Montulli, "HTTP State Management Mechanism", RFC 2109, February 1997.
[RFC2109] Kristol, D. and L. Montulli, "HTTP State Management Mechanism", RFC 2109, February 1997.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC2279] Yergeau, F., "UTF-8, a transformation format of Unicode and ISO-10646", RFC 2279, January 1998.
[RFC2279] Yergeau, F., "UTF-8, a transformation format of Unicode and ISO-10646", RFC 2279, January 1998.
[RFC2396] Berners-Lee, T., Fielding, R. and L. Masinter, "Uniform Resource Identifiers (URI): Generic Syntax", RFC 2396, August 1998.
[RFC2396] Berners-Lee, T., Fielding, R. and L. Masinter, "Uniform Resource Identifiers (URI): Generic Syntax", RFC 2396, August 1998.
[RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H. and T. Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.
[RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H. and T. Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.
Copyright (C) The Internet Society (2000). All Rights Reserved.
Copyright (C) The Internet Society (2000). All Rights Reserved.
This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English.
この文書とその翻訳は、上記の著作権表示とこの段落をすべての複製物および派生物に含めることを条件として、制限を設けずに複製し、他者に提供できます。また、この文書について論評または説明する派生物や、実装を支援する派生物を、全部または一部について作成、複製、公開、配布できます。ただし、インターネット標準を策定するために必要な場合(この場合はInternet Standardsプロセスで定められた著作権手続きを遵守します)、または英語以外の言語へ翻訳する場合を除き、著作権表示やInternet Societyその他のインターネット組織への言及を削除するなど、この文書自体を変更することはできません。
The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.
上記で認められた限定的な許可は永続的であり、Internet Society、その後継者または譲受人によって取り消されません。
This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
この文書および本書に含まれる情報は「現状有姿」で提供されます。INTERNET SOCIETYおよびINTERNET ENGINEERING TASK FORCEは、明示または黙示を問わず、すべての保証を否認します。これには、本書の情報を使用しても権利を侵害しないという保証、商品性の黙示保証、特定目的への適合性の黙示保証が含まれますが、これらに限りません。
Acknowledgement
謝辞
Funding for the RFC Editor function is currently provided by the Internet Society.
RFC Editor機能への資金は、現在Internet Societyが提供しています。