<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><section><h1>BNF</h1><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:">RFC 2965 を元に、 FWS を補うなど修正した</comment-p><pre> http-response  /= Set-Cookie
 http-request   /= Cookie / Cookie2
 Set-Cookie      = &quot;Set-Cookie2:&quot; [FWS] cookies [FWS]
 Cookie          = &quot;Cookie:&quot; [FWS] cookie-version
                   1*([FWS] cookie-separator [FWS] cookie-value) [FWS]
 Cookie2         = &quot;Cookie2:&quot; cookie-version
 cookie-separator = &quot;;&quot;  ;; 過去との互換性のためこちらを使用する
                  / &quot;,&quot;  ;; 将来との互換性のためサーバーは認識<strong>すべし</strong></pre><pre> cookies         = a-cookie *([FWS] &quot;,&quot; [FWS] a-cookie)
 a-cookie        = NAME [FWS] &quot;=&quot; [FWS] VALUE *([FWS] &quot;;&quot; [FWS] cookie-av)
 cookie-av       = comment-av / domain-av / max-age-av / path-av
                 / secure-av / version-av / commenturl-av / discard-av
                 / port-av
 cookie-value    = NAME [FWS] &quot;=&quot; [FWS] VALUE <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">FWS] &quot;;&quot; [FWS] path]
                   <anchor>FWS] &quot;;&quot; [FWS] domain<title xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:">[FWS] &quot;;&quot; [FWS] port]</title></anchor></anchor></pre><pre> NAME            = attr  ;; 「$」で始まる名前は予約
 VALUE           = value
 comment-av      = &quot;Comment&quot; [FWS] &quot;=&quot; [FWS] utf-8-value
 domain-av       = &quot;Domain&quot; [FWS] &quot;=&quot; [FWS] domain-value
 max-age-av      = &quot;Max-Age&quot; [FWS] &quot;=&quot; [FWS] delta-value
 path-av         = &quot;Path&quot; [FWS] &quot;=&quot; [FWS] path-value
 secure-av       = &quot;Secure&quot;
 version-av      = &quot;Version&quot; [FWS] &quot;=&quot; [FWS] version
 path            = &quot;$Path&quot; [FWS] &quot;=&quot; [FWS] path-value
 domain          = &quot;$Domain&quot; [FWS] &quot;=&quot; [FWS] domain-value
 cookie-version  = &quot;$Version&quot; [FWS] &quot;=&quot; [FWS] version-value
 commenturl-av   = &quot;CommentURL&quot; [FWS] &quot;=&quot; [FWS] &lt;&quot;&gt; http_URL &lt;&quot;&gt;
 discard-av      = &quot;Discard&quot;
 port-av         = &quot;Port&quot; [ [FWS] &quot;=&quot; [FWS] &lt;&quot;&gt; portlist &lt;&quot;&gt; ]
 port            = &quot;$Port&quot; [ [FWS] &quot;=&quot; [FWS] &lt;&quot;&gt; portlist &lt;&quot;&gt; ]</pre><pre> attr            = http-token
 value           = http-token / quoted-string
 domain-value    = [&quot;.&quot;] dot-http-token / &lt;&quot;&gt; [&quot;.&quot;] dot-atom &lt;&quot;&gt;
 path-value      = abs_path / &lt;&quot;&gt; abs_path &lt;&quot;&gt;
 delta-value     = delta-seconds / &lt;&quot;&gt; delta-seconds &lt;&quot;&gt;
 delta-seconds   = 1*DIGIT
 this-version    = &quot;1&quot;   ;; 1*DIGIT
 version         = 1*DIGIT
 version-value   = version / &lt;&quot;&gt; version &lt;&quot;&gt;
 portlist        = portnum *([FWS] &quot;,&quot; [FWS] portnum)
 portnum         = 1*DIGIT
 utf-8           = &lt;a UTF-8 [RFC 2279] character&gt;
 utf-8-value     = *token / &lt;&quot;&gt; *utf-8 &lt;&quot;&gt;</pre></section><section><h1>例</h1><ul><li>Set-Cookie2: Customer=&quot;WILE_E_COYOTE&quot;; Version=&quot;1&quot;; Path=&quot;/acme&quot;</li><li>Cookie: $Version=&quot;1&quot;; Customer=&quot;WILE_E_COYOTE&quot;; $Path=&quot;/acme&quot;</li><li>Set-Cookie2: Part_Number=&quot;Rocket_Launcher_0001&quot;; Version=&quot;1&quot;; Path=&quot;/acme&quot;</li><li>Cookie: $Version=&quot;1&quot;; Customer=&quot;WILE_E_COYOTE&quot;; $Path=&quot;/acme&quot;; Part_Number=&quot;Rocket_Launcher_0001&quot;; $Path=&quot;/acme&quot;</li><li>Cookie2: $Version=&quot;1&quot;</li></ul></section><section><h1>See also</h1><ul><li><anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="urn:ietf:rfc:2965" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI">urn:ietf:rfc:2965</anchor-external></li><li><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Cookie</anchor><ul><li><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">NetscapeのCookie仕様</anchor></li><li><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">RFC2109のCookie仕様</anchor></li></ul></li><li><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">HTTP</anchor></li><li><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">RFC822と仲間達の頭領域名</anchor><ul><li><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Set-Cookie:領域</anchor></li><li><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Cookie:領域</anchor></li></ul></li><li><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">CGI</anchor></li><li><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">HTML</anchor><ul><li><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">META要素</anchor></li><li><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Script要素</anchor><ul><li><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">JavaScript</anchor></li></ul></li></ul></li></ul></section></body></html>