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
        
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.

本文件规定了互联网社区的互联网标准跟踪协议,并要求进行讨论和提出改进建议。有关本协议的标准化状态和状态,请参考当前版本的“互联网官方协议标准”(STD 1)。本备忘录的分发不受限制。

Copyright Notice

版权公告

Copyright (C) The Internet Society (2000). All Rights Reserved.

版权所有(C)互联网协会(2000年)。版权所有。

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.)

本文档指定了使用超文本传输协议(HTTP)请求和响应创建有状态会话的方法。它描述了三个新的头文件Cookie、Cookie2和Set-Cookie2,它们在参与的源服务器和用户代理之间传递状态信息。这里描述的方法不同于Netscape的Cookie方案[Netscape],但它可以与使用Netscape方法的HTTP/1.0用户代理进行互操作。(请参见历史部分。)

This document reflects implementation experience with RFC 2109 and obsoletes it.

本文件反映了RFC 2109的实施经验,并将其淘汰。

1. TERMINOLOGY
1. 术语

The terms user agent, client, server, proxy, origin server, and http_URL have the same meaning as in the HTTP/1.1 specification [RFC2616]. The terms abs_path and absoluteURI have the same meaning as in the URI Syntax specification [RFC2396].

术语用户代理、客户端、服务器、代理、源服务器和http_URL的含义与http/1.1规范[RFC2616]中的含义相同。术语abs_path和absoluteURI与URI语法规范[RFC2396]中的含义相同。

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)或数字互联网协议(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请求行的绝对URI(http_URL)的主机(而不是端口)和abs_路径部分发送给服务器的值。请注意,请求主机是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.

术语有效主机名与主机名相关。如果主机名不包含点,则有效的主机名是附加了字符串.local的名称。否则,有效主机名与主机名相同。请注意,所有有效主机名至少包含一个点。

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.

术语“请求端口”指的是http请求行的绝对URI(http_URL)的端口部分。如果absoluteURI没有显式端口,则请求端口为HTTP默认端口80。cookie的请求端口是将Set-Cookie2响应头返回给用户代理的请求的请求端口。

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字符串。有时我们会将一个主机名与另一个主机名进行比较。(此类比较不区分大小写。)主机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至少有一个嵌入点,或者B是字符串“local”。那么H的范围是。

* 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.

对于表示路径的两个字符串P1和P2,如果P2是P1的前缀,则P1 path与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这个术语来指代在源服务器和用户代理之间传递并由用户代理存储的状态信息。

1.1 Requirements
1.1 要求

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].

本文件中的关键词“可”、“必须”、“不得”、“可选”、“建议”、“要求”、“应”、“不应”、“应”、“不应”应按照RFC 2119[RFC2119]中所述进行解释。

2. STATE AND SESSIONS
2. 州和届会

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的客户端提供内容。

3. DESCRIPTION
3. 描述

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和用户代理的影响降至最低。

3.1 Syntax: General
3.1 语法:一般

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

两个状态管理头Set-Cookie2和Cookie具有涉及属性值对的公共语法属性。下面的语法使用表示法和记号数字(十进制数字)、记号

(informally, a sequence of non-special, non-white space characters), and http_URL from the HTTP/1.1 specification [RFC2616] to describe their syntax.

(非正式地说,是一系列非特殊、非空白字符)和http/1.1规范[RFC2616]中的http_URL来描述它们的语法。

   av-pairs    =     av-pair *(";" av-pair)
   av-pair     =     attr ["=" value]              ; optional value
   attr        =     token
   value       =     token | quoted-string
        
   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)不区分大小写。令牌之间允许空白。注意,尽管上面的语法描述将value显示为可选值,但大多数attr都需要它们。

NOTE: The syntax above allows whitespace between the attribute and the = sign.

注意:上面的语法允许在属性和=符号之间使用空格。

3.2 Origin Server Role
3.2 源服务器角色

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请求头(见下文)。源服务器可能会忽略它或使用它来确定会话的当前状态。它可以向客户端发回具有相同或不同信息的Set-Cookie2响应头,也可以根本不发送Set-Cookie2头。原始服务器通过向客户端发送一个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响应头。用户代理应根据下面详述的其他规则,在每个请求中发送Cookie请求头。

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.

源服务器可以在响应中包含多个Set-Cookie2头。注意,中间网关可以将多个这样的报头折叠成一个报头。

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
        
   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响应头包含令牌Set-Cookie2:,后跟一个或多个cookie的逗号分隔列表。每个cookie都以名称=值对开头,后跟零个或多个分号分隔的属性值对。前面显示了属性值对的语法。具体属性及其值的语义如下。在每个cookie中,NAME=VALUE属性值对必须排在第一位。其他的,如果存在,可以以任何顺序出现。如果某个属性在cookie中出现不止一次,则客户端应仅使用与该属性第一次出现相关联的值;客户端必须忽略第一个之后的值。

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的名称可能与本规范中的一个属性相同。但是,由于cookie的名称在Set-Cookie2响应头中必须排在第一位,因此不能将名称及其值与属性-值对混淆。

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.

名称=所需的值。状态信息(“cookie”)的名称是name,其值是value。以$开头的名称是保留的,应用程序不得使用。

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.

该值对于用户代理是不透明的,可能是源服务器选择发送的任何内容,可能是服务器选择的可打印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]

注释=可选值。由于cookie可用于派生或存储用户的私人信息,因此Comment属性的值允许源服务器记录其打算如何使用cookie。用户可以检查信息以决定是否使用此cookie启动或继续会话。值中的字符必须采用UTF-8编码。[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\u URL”可选。由于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属性指示用户代理在用户代理终止时无条件地丢弃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属性的值指定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属性的值是delta seconds,cookie的生存期(以秒为单位),是一个十进制非负整数。要正确处理缓存的cookie,客户端应根据HTTP/1.1规范[RFC2616]中的年龄计算规则计算cookie的年龄。当时间大于增量秒时,客户端应丢弃cookie。值为零表示应立即丢弃cookie。

Path=value OPTIONAL. The value of the Path attribute specifies the subset of URLs on the origin server to which this cookie applies.

路径=可选值。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属性限制cookie请求头中可返回cookie的端口。注意,即使portlist中只有一个portnum,语法也需要在可选portlist周围加引号。

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属性(不带值)指示用户代理在发回此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.

用户代理(可能与用户交互)可以确定其认为适合“安全”cookie的安全级别。安全属性应该被认为是从服务器到用户代理的安全建议,表明保护cookie内容符合会话的利益。当它将“安全”cookie发送回服务器时,用户代理应使用不低于从服务器接收cookie时使用的安全级别。

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属性的值(十进制整数)标识cookie符合的状态管理规范的版本。对于本规范,版本=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头的效果。缓存“公共”文档是可取的。例如,如果源服务器希望使用诸如“前门”页面之类的公共文档作为哨兵,以指示必须为其生成Set-Cookie2响应头的会话的开始,则该页面应存储在“预过期”的缓存中,以便源服务器将看到进一步的请求。“私有文档”,例如那些包含对会话严格私有的信息的文档,不应该缓存在共享缓存中。

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计划由单个用户使用,则不应缓存Set-Cookie2头。可以缓存打算由多个用户共享的Set-Cookie2头。

The origin server SHOULD send the following additional HTTP/1.1 response headers, depending on circumstances:

根据具体情况,源服务器应发送以下附加HTTP/1.1响应头:

* To suppress caching of the Set-Cookie2 header:

* 要禁止缓存Set-Cookie2标头,请执行以下操作:

Cache-control: no-cache="set-cookie2"

缓存控制:无缓存=“set-cookie2”

and one of the following:

以及下列其中一项:

* To suppress caching of a private document in shared caches:

* 要禁止在共享缓存中缓存私有文档,请执行以下操作:

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

缓存控制:必须重新验证,最大期限=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

缓存控制:代理重新验证,最大年龄=0

* To allow caching of a document and request that it be validated before returning it to the client (by "pre-expiring" it):

* 要允许缓存文档并请求在将其返回到客户端之前对其进行验证(通过“预过期”方式),请执行以下操作:

Cache-control: max-age=0

缓存控制:最大年龄=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服务器必须在包含Set-Cookie2响应头的响应上发送Expires:old date(其中old date是过去很长的日期),除非它们确定(通过带外方式)响应链中没有HTTP/1.0代理。除了Expires:old-date指令外,HTTP/1.1服务器还可以发送允许HTTP/1.1代理缓存的其他缓存控制指令;缓存控制指令将覆盖HTTP/1.1代理的Expires:old日期。

3.3 User Agent Role
3.3 用户代理角色

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用户代理会单独跟踪通过Set-Cookie2响应头从每个源服务器(通过名称或IP地址和端口区分)到达的状态信息。用户代理必须忽略其属性无法识别的属性-值对。用户代理将这些默认值应用于缺少的可选属性:

Discard The default behavior is dictated by the presence or absence of a Max-Age attribute.

放弃默认行为由是否存在“最大年龄”属性决定。

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.)

域默认为有效的请求主机。(请注意,因为在有效请求主机的开头没有点,所以默认域只能与自身匹配。)

Max-Age The default behavior is to discard the cookie when the user agent exits.

最大年龄默认行为是在用户代理退出时丢弃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.

端口默认行为是cookie可以返回到任何请求端口。

Secure If absent, the user agent MAY send the cookie over an insecure channel.

安全如果不存在,用户代理可能会通过不安全的通道发送cookie。

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。规则的目标是根据路径、域和端口属性的值以及请求URI、请求主机和请求端口,尝试限制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:

如果版本属性丢失,用户代理将拒绝(不应存储其信息)。此外,如果Set-Cookie2响应头中明确显示的属性存在以下任何一种情况,则用户代理拒绝(不应存储其信息):

* The value for the Path attribute is not a prefix of the request-URI.

* Path属性的值不是请求URI的前缀。

* The value for the Domain attribute contains no embedded dots, and the value is not .local.

* 域属性的值不包含嵌入点,并且该值不是.local。

* The effective host name that derives from the request-host does not domain-match the Domain attribute.

* 从请求主机派生的有效主机名与域属性不匹配。

* 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.

* 请求主机是一个HDN(不是IP地址),其格式为HD,其中D是Domain属性的值,H是包含一个或多个点的字符串。

* The Port attribute has a "port-list", and the request-port was not in the list.

* 端口属性有一个“端口列表”,请求端口不在列表中。

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.

* 域=.foo.com的请求主机y.x.foo.com的Set-Cookie2将被拒绝,因为H是y.x并且包含一个点。

* A Set-Cookie2 from request-host x.foo.com for Domain=.foo.com would be accepted.

* 将接受来自请求主机x.foo.com的域=.foo.com的Set-Cookie2。

* A Set-Cookie2 with Domain=.com or Domain=.com., will always be rejected, because there is no embedded dot.

* 域为.com或域为.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.

* 如果向端口80或8000发出请求,则将接受端口为“808000”的Set-Cookie2,否则将被拒绝。

* 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.

* 由于请求主机的有效主机名为example.local,example.local域匹配.local,因此将接受来自请求主机example的Set-Cookie2。

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管理如果用户代理收到一个Set-Cookie2响应头,该响应头的名称与其以前存储的Cookie的名称相同,则新Cookie将在以下情况下取代旧Cookie:新旧域属性值比较相等,使用不区分大小写的字符串比较;并且,新旧路径属性值字符串比较相等(区分大小写)。但是,如果Set-Cookie2的Max Age值为零,则(旧的和新的)cookie将被丢弃。否则,cookie将一直存在(资源允许),直到先发生的情况发生为止,然后被丢弃:超过其最长使用寿命;或者,如果设置了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来为新的cookie腾出空间,例如使用最近最少使用的算法,以及每个源服务器可以设置的cookie最大数量的限制。

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响应头包含注释属性,则用户代理应将该信息与cookie一起以人类可读的形式存储,并应将注释文本显示为cookie检查用户界面的一部分。

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一起以人类可读的形式存储,或者,优选地,应允许用户遵循http_URL链接作为cookie检查用户界面的一部分。

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。用户代理可以丢弃在此上下文中接收到的任何cookie,该cookie是用户通过某些用户代理机制认为不可接受的。

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销毁,但它们不能将cookie的生存期延长到由Discard和Max Age属性控制的生存期之外。一个不经常使用的cookie可以作为网络应用程序的“首选项文件”,用户可能希望保留它,即使它是最近使用最少的cookie。一个可能的实现是一个接口,该接口允许通过复选框永久存储cookie(或者,相反,允许立即销毁cookie)。

Privacy considerations dictate that the user have considerable control over cookie management. The PRIVACY section contains more information.

隐私考虑决定了用户对cookie管理有相当大的控制权。隐私部分包含更多信息。

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,则该用户代理会根据

* the request-host and request-port;

* 请求主机和请求端口;

* the request-URI;

* 请求URI;

* the cookie's age.

* 饼干的年龄。

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 <"> ]
        
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

cookie version属性的值必须是相应Set-Cookie2响应头的version属性中的值。否则,cookie版本的值为0。路径的值

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.

属性必须是对应Set-Cookie2响应头的Path属性(如果存在)中的值。否则,应该从Cookie请求头中省略该属性。domain属性的值必须是相应Set-Cookie2响应头的domain属性(如果存在)中的值。否则,应该从Cookie请求头中省略该属性。

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请求标头的端口属性必须镜像相应Set-Cookie2响应标头中的端口属性(如果存在)。也就是说,如果Set-Cookie2报头中存在端口属性,则端口属性必须存在,并且必须具有相同的值(如果有)。否则,如果Set-Cookie2报头中没有Port属性,那么同样必须从Cookie请求报头中省略该属性。

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响应头中的属性相对应的Cookie请求头中既没有Comment属性,也没有CommentURL属性。用户代理不会将注释信息返回到源服务器。

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.

域选择源服务器的有效主机名必须与cookie的域属性匹配。

Port Selection There are three possible behaviors, depending on the Port attribute in the Set-Cookie2 response header:

端口选择根据Set-Cookie2响应头中的端口属性,有三种可能的行为:

1. By default (no Port attribute), the cookie MAY be sent to any port.

1. 默认情况下(无端口属性),cookie可以发送到任何端口。

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. 如果属性存在但没有值(例如端口),则必须仅将cookie发送到从中接收cookie的请求端口。

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. 如果该属性具有端口列表,则只有当新请求端口是端口列表中列出的端口之一时,才能返回cookie。

Path Selection The request-URI MUST path-match the Path attribute of the cookie.

路径选择请求URI的路径必须与cookie的路径属性匹配。

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头中排序,以便具有更特定路径属性的Cookie优先于具有更少特定路径属性的Cookie。未指定与其他属性(如域)相关的顺序。

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值之间的分隔符,以实现将来的兼容性。

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规范的客户端和服务器之间的互操作。当客户端向源服务器发送一个或多个cookie时,如果这些cookie中至少有一个包含$Version属性,其值与客户端理解的版本不同,则客户端还必须发送Cookie2请求头,其语法为

cookie2 = "Cookie2:" cookie-version

cookie2=“cookie2:“cookie版本”

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)。客户端最多需要为每个请求发送一个这样的请求头。

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用户必须控制会话以确保隐私。(见下面的隐私部分。)为了简化实施并防止在存在充分保护措施的情况下增加复杂性,本文件对可验证交易和不可验证交易进行了区分。如果用户或用户指定的代理可以选择在事务中使用请求URI之前查看请求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.

如果第三方主机的请求主机U的域与原始事务中请求主机O的到达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处理(即,不得发送cookie,也不得接受任何接收到的cookie)。

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".

用户代理可以提供可配置选项,允许用户代理或用户代理执行的任何自治程序忽略上述规则,只要这些覆盖选项默认为“关闭”。

(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源的选项,或者将源保存到外部文件中,以便其他应用程序查看。虽然这样的选项确实提供了一个粗略的评审机制,但有些用户可能不认为它是可以接受的。

3.4 How an Origin Server Interprets the Cookie Header
3.4 源服务器如何解释Cookie头

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.

当请求URI路径与cookie的path属性匹配时,用户代理将Set-Cookie2头中的大部分信息返回给源服务器。当收到Cookie头时,源服务器应将前缀为$specially的Cookie作为Cookie的属性。

3.5 Caching Proxy Role
3.5 缓存代理角色

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和文档内容分离的一个原因是为了方便缓存允许的扩展。要支持Cookie,缓存代理必须遵守HTTP规范中已有的以下规则:

* 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

缓存控制:没有缓存

and

Cache-control: private

缓存控制:专用

* Cache the Set-Cookie2 subject to the control of the usual header,

* 缓存Set-Cookie2,受常用头的控制,

Cache-control: no-cache="set-cookie2"

缓存控制:无缓存=“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)头。

4. EXAMPLES
4. 例子
4.1 Example 1
4.1 例1

Most detail of request and response headers has been omitted. Assume the user agent has no stored cookies.

请求和响应头的大部分细节已被省略。假设用户代理没有存储的cookie。

1. User Agent -> Server

1. 用户代理->服务器

POST /acme/login HTTP/1.1 [form data]

POST/acme/login HTTP/1.1[表单数据]

User identifies self via a form.

用户通过表单识别自己。

2. Server -> User Agent

2. 服务器->用户代理

        HTTP/1.1 200 OK
        Set-Cookie2: Customer="WILE_E_COYOTE"; Version="1"; Path="/acme"
        
        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. 用户代理->服务器

        POST /acme/pickitem HTTP/1.1
        Cookie: $Version="1"; Customer="WILE_E_COYOTE"; $Path="/acme"
        [form data]
        
        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. 服务器->用户代理

        HTTP/1.1 200 OK
        Set-Cookie2: Part_Number="Rocket_Launcher_0001"; Version="1";
                Path="/acme"
        
        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. 用户代理->服务器

        POST /acme/shipping HTTP/1.1
        Cookie: $Version="1";
                Customer="WILE_E_COYOTE"; $Path="/acme";
                Part_Number="Rocket_Launcher_0001"; $Path="/acme"
        [form data]
        
        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. 服务器->用户代理

        HTTP/1.1 200 OK
        Set-Cookie2: Shipping="FedEx"; Version="1"; Path="/acme"
        
        HTTP/1.1 200 OK
        Set-Cookie2: Shipping="FedEx"; Version="1"; Path="/acme"
        

New cookie reflects shipping method.

新cookie反映了运输方法。

7. User Agent -> Server

7. 用户代理->服务器

        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]
        
        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. 服务器->用户代理

HTTP/1.1 200 OK

HTTP/1.1200ok

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都具有相同的路径属性和(默认)域。因为请求uri是all path match/acme,即每个cookie的path属性,所以每个请求都包含迄今为止收到的所有cookie。

4.2 Example 2
4.2 例2

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.

此示例演示了路径属性的效果。请求和响应头的所有细节都被省略了。假设用户代理没有存储的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"
        
   Set-Cookie2: Part_Number="Rocket_Launcher_0001"; Version="1";
           Path="/acme"
        

and

   Set-Cookie2: Part_Number="Riding_Rocket_0023"; Version="1";
           Path="/acme/ammo"
        
   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"
        
   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.

请注意,具有更具体路径属性/acme/ammo的cookie的NAME=VALUE对位于具有不太具体路径属性/acme的cookie对之前。进一步注意,相同的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:

用户代理随后向(同一)服务器请求/acme/parts/格式的URL时,将包括以下请求头:

   Cookie: $Version="1"; Part_Number="Rocket_Launcher_0001";
   $Path="/acme"
        
   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.

在这里,第二个cookie的路径属性/acme/ammo不是请求URL的前缀/acme/parts/,因此cookie不会被转发到服务器。

5. IMPLEMENTATION CONSIDERATIONS
5. 实施考虑

Here we provide guidance on likely or desirable details for an origin server that implements state management.

这里,我们为实现状态管理的源服务器提供可能的或需要的详细信息的指导。

5.1 Set-Cookie2 Content
5.1 Set-Cookie2内容

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. 当用户代理终止会话(例如退出)时,如何以及何时对数据库项进行垃圾收集。

5.2 Stateless Pages
5.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的可伸缩性。因此,减少嵌入状态的文档数量非常重要。例如,如果购物篮样式的应用程序总是在每个页面上显示用户的当前购物篮内容,则无法缓存这些页面,因为每个用户的购物篮内容都会不同。另一方面,如果每个页面只包含一个允许用户“查看我的购物篮”的链接,则可以缓存该页面。

5.3 Implementation Limits
5.3 实施限制

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支持应该没有固定的限制。他们应该努力储存尽可能多的常用饼干。此外,通用用户代理应单独(但不一定同时)提供以下各项最低功能:

* at least 300 cookies

* 至少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至少4096字节(由Set-Cookie2头的语法描述中组成cookie非终端的字符测量,并在Set-Cookie2头中接收)

* at least 20 cookies per unique host or domain name

* 每个唯一主机或域名至少20个cookie

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.

为特定目的或为容量有限的设备创建的用户代理应提供至少20个4096字节的cookie,以确保用户可以与基于会话的源服务器交互。

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响应头中的信息必须全部保留。如果由于某种原因,没有足够的空间来存储cookie,则必须将其丢弃,而不是截断。

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信息的大小设置上限。否则,恶意服务器可能试图在连续响应时向用户代理发送大量cookie或大型cookie,这将强制用户代理从其他服务器接收到cookie。但是,仍应支持上述规定的最小值。

6. PRIVACY
6. 隐私

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的系统的设计。用户应该能够了解网站计划如何在cookie中使用信息,并且应该能够选择这些策略是否可以接受。用户代理和源服务器都必须协助知情同意。

6.1 User Agent Control
6.1 用户代理控制

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头来跟踪用户通过服务器的路径。用户可能会反对这种行为,认为这是一种侵入性的信息积累,即使他们的身份不明显。(例如,如果用户随后填写了包含标识信息的表单,则标识可能会变得明显。)因此,此状态管理规范要求用户代理为用户提供对此类可能入侵的控制,尽管未指定为用户提供此控制的接口。但是,提供的控制机制应至少允许用户

* 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的域属性控制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头,在这种情况下,它永远无法保持源服务器的状态。(然后,用户代理的行为将类似于不知道如何处理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.

当用户代理终止执行时,它应该让用户放弃所有状态信息。或者,用户代理可以询问用户是否应该保留状态信息;默认值应为“否”。如果用户选择保留状态信息,则将在下次运行用户代理时恢复状态信息。

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可能会混合或损坏。

6.2 Origin Server Role
6.2 源服务器角色

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或注释信息来促进知情同意。CommentURL是首选,因为它有机会以多种语言提供更丰富的信息。

6.3 Clear Text
6.3 明文

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.

共享用户环境中的用户代理会带来进一步的风险。使用cookie检查界面,用户B可以检查用户a使用机器时保存的cookie内容。

7. SECURITY CONSIDERATIONS
7. 安全考虑
7.1 Protocol Design
7.1 协议设计

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.

对域属性值的限制以及有关无法验证的事务的规则旨在减少Cookie“泄漏”到“错误”站点的方式。其目的是将cookie限制在一台主机或一组密切相关的主机上。因此,请求主机只能为域设置哪些值。我们认为主机Ho.1.Fo.com和Hoest2.FooWo可以共享cookies,但不能接受Ac++和B.com。

Similarly, a server can set a Path only for cookies that are related to the request-URI.

类似地,服务器只能为与请求URI相关的cookie设置路径。

7.2 Cookie Spoofing
7.2 曲奇欺骗

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. 用户代理向Victor.cracker.edu发出请求,返回cookie会话\u id=“1234”,并设置默认域Victor.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会话id=“1111”。

3. User agent makes request to victim.cracker.edu again, and passes

3. 用户代理再次向Victor.cracker.edu发出请求,并通过

         Cookie: $Version="1"; session_id="1234",
                 $Version="1"; session_id="1111"; $Domain=".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.

位于Visume.cracker.edu的服务器应通过注意域属性不是为其本身而创建的,从而检测到第二个cookie不是它所创建的cookie,并忽略它。

7.3 Unexpected Cookie Sharing
7.3 意外的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.

用户代理应尽一切努力防止在不同域中的主机之间共享会话信息。如果嵌入式或内联对象可用于在不同主机之间共享cookie,则它们可能会导致特别严重的隐私问题。例如,恶意服务器可以将主机a.com的cookie信息嵌入主机b.com上CGI的URI中。强烈鼓励用户代理实现者尽可能防止此类交换。

7.4 Cookies For Account Information
7.4 帐户信息的Cookies

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并不是设计用来保存身份验证信息,例如帐户名和密码。除非通过加密路径交换此类cookie,否则其包含的帐户信息极易被阅读和窃取。

8. OTHER, SIMILAR, PROPOSALS
8. 其他类似建议

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].

除RFC2109外,还提出了其他三项建议,以实现类似的目标。该规范最初是Kristol的州信息提案[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提出了一个会话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包含用户选择的简单信息。

9. HISTORICAL
9. 历史的
9.1 Compatibility with Existing Implementations
9.1 与现有实现的兼容性

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信息。此外,如果用户代理收到Set-Cookie2响应头,则必须假设发送服务器符合此文档,并且将理解也遵循此规范的Cookie请求头。

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和新cookie。也就是说,如果同时遵循此规范和Netscape原始规范的用户代理收到Set-Cookie2响应头,并且名称、域和路径属性(根据Cookie管理部分)与Netscape风格的Cookie匹配,则必须丢弃Netscape风格的Cookie,并且用户代理必须仅保留符合此规范的cookie。

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-Cookie响应头而不是Set-Cookie2响应头中收到Cookie,则应发送遵循旧Netscape规范的Cookie请求头。但是,它还应发送以下请求标头:

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-Cookie2响应头而不是Set-Cookie来继续有状态会话。不理解新型Cookie的服务器将忽略Cookie2请求头。

9.2 Caching and HTTP/1.0
9.2 缓存与HTTP/1.0

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的缓存,将不可避免地缓存Set-Cookie2和Set-Cookie头,因为在HTTP/1.1之前没有抑制头缓存的机制。这种缓存会导致安全问题。原始服务器与Set-Cookie2和Set-Cookie头一起传输的文档通常是不可缓存的,或者是“预过期的”。只要缓存遵循不缓存文档的指示(过期后:<a date in the pass>或Pragma:no cache(HTTP/1.0)或cache control:no cache(HTTP/1.1)),不可缓存的文档就不会出现问题。但是,预过期的文档可能存储在缓存中。它们要求对每个新请求进行验证(有条件的GET),但一些缓存操作员放松了缓存规则,有时在未首先验证过期文档的情况下提供过期文档。这些因素的组合可能导致一个用户的cookie稍后被发送给另一个用户。Set-Cookie2和Set-Cookie头存储在缓存中,尽管文档已过时(过期),缓存仍会返回文档以响应稍后的请求,包括缓存头。

10. ACKNOWLEDGEMENTS
10. 致谢

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。

11. AUTHORS' ADDRESSES
11. 作者地址

David M. Kristol Bell Laboratories, Lucent Technologies 600 Mountain Ave. Room 2A-333 Murray Hill, NJ 07974

David M.Kristol Bell实验室,朗讯科技有限公司山路600号,新泽西州默里山2A-333室,邮编:07974

Phone: (908) 582-2250 Fax: (908) 582-1239 EMail: dmk@bell-labs.com

电话:(908)582-2250传真:(908)582-1239电子邮件:dmk@bell-实验室网站

Lou Montulli Epinions.com, Inc. 2037 Landings Dr. Mountain View, CA 94301

Lou Montulli Epinions.com,Inc.2037年加利福尼亚州山景城着陆博士94301

   EMail: lou@montulli.org
        
   EMail: lou@montulli.org
        
12. REFERENCES
12. 参考资料

[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.,“提议的HTTP状态信息机制”,可在<http://portal.research.bell-labs.com/~dmk/state info.html>,1995年9月。

[Netscape] "Persistent Client State -- HTTP Cookies", available at <http://www.netscape.com/newsref/std/cookie_spec.html>, undated.

[Netscape]“持久性客户端状态--HTTP Cookies”,可在<http://www.netscape.com/newsref/std/cookie_spec.html>,未注明日期。

[RFC2109] Kristol, D. and L. Montulli, "HTTP State Management Mechanism", RFC 2109, February 1997.

[RFC2109]Kristol,D.和L.Montulli,“HTTP状态管理机制”,RFC2109,1997年2月。

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.

[RFC2119]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,1997年3月。

[RFC2279] Yergeau, F., "UTF-8, a transformation format of Unicode and ISO-10646", RFC 2279, January 1998.

[RFC2279]Yergeau,F.,“UTF-8,Unicode和ISO-10646的转换格式”,RFC 2279,1998年1月。

[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.和L.Masinter,“统一资源标识符(URI):通用语法”,RFC 2396,1998年8月。

[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.和T.Berners-Lee,“超文本传输协议——HTTP/1.1”,RFC 2616,1999年6月。

13. Full Copyright Statement
13. 完整版权声明

Copyright (C) The Internet Society (2000). All Rights Reserved.

版权所有(C)互联网协会(2000年)。版权所有。

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.

本文件及其译本可复制并提供给他人,对其进行评论或解释或协助其实施的衍生作品可全部或部分编制、复制、出版和分发,不受任何限制,前提是上述版权声明和本段包含在所有此类副本和衍生作品中。但是,不得以任何方式修改本文件本身,例如删除版权通知或对互联网协会或其他互联网组织的引用,除非出于制定互联网标准的需要,在这种情况下,必须遵循互联网标准过程中定义的版权程序,或根据需要将其翻译成英语以外的其他语言。

The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.

上述授予的有限许可是永久性的,互联网协会或其继承人或受让人不会撤销。

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.

本文件和其中包含的信息是按“原样”提供的,互联网协会和互联网工程任务组否认所有明示或暗示的保证,包括但不限于任何保证,即使用本文中的信息不会侵犯任何权利,或对适销性或特定用途适用性的任何默示保证。

Acknowledgement

确认

Funding for the RFC Editor function is currently provided by the Internet Society.

RFC编辑功能的资金目前由互联网协会提供。