Set-Cookie:通配符“路径” [英] Set-Cookie: Wildcard "Path"
本文介绍了Set-Cookie:通配符“路径”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可以在HTTP Set-Cookie请求中放置path参数的通配符前缀吗?
示例:
Set-Cookie:SSID = foo; Domain = .foo.com; Path = / * / Stuff;安全; HttpOnly
解决方案
检查 RFC 6265 HTTP状态管理机制,5.1.4。路径和路径匹配:
请求路径路径匹配给定的cookie路径,如果至少一个
以下条件成立:
o cookie路径和请求路径是相同的。
o cookie-path是请求路径的前缀,cookie路径的最后一个
字符是%x2F(/)。
o cookie-path是请求路径的前缀,并且请求路径的第一个
字符不包括在cookie-
路径中,它是一个% x2F(/)字符。
它没有提及任何通配符处理,因此不可能在路径中使用通配符。 p>
Is it possible to place a wildcard infront of the "path" parameter in a HTTP Set-Cookie request?
example:
Set-Cookie: SSID=foo; Domain=.foo.com; Path=/*/Stuff; Secure; HttpOnly
解决方案
Check 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.
It does not mention any wildcard handling, so it's not possible to use wildcards in the path.
这篇关于Set-Cookie:通配符“路径”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文