<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 2109 を元に、 FWS を補うなど修正した</comment-p><pre> http-response  /= Set-Cookie
 http-request   /= Cookie
 Set-Cookie      = &quot;Set-Cookie:&quot; [FWS] cookies [FWS]
 Cookie          = &quot;Cookie:&quot; [FWS] cookie-version
                   1*([FWS] cookie-separator [FWS] cookie-value) [FWS]
 cookie-separator = &quot;;&quot;  ;; 過去との互換性のためこちらを使用する
                  / &quot;,&quot;  ;; 将来との互換性のためサーバーは認識すべし</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
 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]</anchor></anchor></pre><pre> NAME            = attr  ;; 「$」で始まる名前は予約
 VALUE           = value
 comment-av      = &quot;Comment&quot; [FWS] &quot;=&quot; [FWS] 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
 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
 version         = &quot;1&quot;   ;; 1*DIGIT
 version-value   = version / &lt;&quot;&gt; version &lt;&quot;&gt;</pre></section><section><h1>例</h1><ul><li>Set-Cookie: 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-Cookie: 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></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:2109" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI">urn:ietf:rfc:2109</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></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><section><h1>メモ</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="1" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[1]</anchor-end> <cite>M-Fr Net Miscellany Cookie</cite> (<time>2006-11-06 15:58:05 +09:00</time> 版) <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://www.m-fr.net/etc/cookie.html" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI">http://www.m-fr.net/etc/cookie.html</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2]</anchor-end> <anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="1" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;1</anchor-internal> ま、この文書の主張はそんな的外れではないんだけど、こと <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Cookie</anchor>
に関しては非互換仕様を後から出してきた <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">IETF</anchor> が悪いでしょうな。
しかも色々不運が重なっちゃってすぐ実装されなかったのは仕方ないとしても、 <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Cookie2</anchor>
なんて更に非互換な不良債権まで作っちゃったからな。。。</p></section></body></html>