Set-Cookie:通配符“路径”

时间:2011-11-04 18:22:35

标签: http cookies

是否可以在HTTP Set-Cookie请求中放置“path”参数前面的通配符?

示例:

Set-Cookie: SSID=foo; Domain=.foo.com; Path=/*/Stuff; Secure; HttpOnly

1 个答案:

答案 0 :(得分:40)

检查RFC 6265 HTTP State Management Mechanism, 5.1.4. Paths and Path-Match

 A request-path path-matches a given cookie-path if at least one of
   the following conditions holds:

   o  The cookie-path and the request-path are identical.

   o  The cookie-path is a prefix of the request-path, and the last
      character of the cookie-path is %x2F ("/").

   o  The cookie-path is a prefix of the request-path, and the first
      character of the request-path that is not included in the cookie-
      path is a %x2F ("/") character.

它没有提到任何通配符处理,因此无法在路径中使用通配符。