【发布时间】:2016-11-27 09:35:33
【问题描述】:
目前我已阅读 RCF 6265 章节 4.1.1 关于 set-cookie 标头的语法。 在4.1.1正文中:
Each cookie begins with
a name-value-pair, followed by zero or more attribute-value pairs.
Servers SHOULD NOT send Set-Cookie headers that fail to conform to
the following grammar:
语法列表中有一个条目:
token = <token, defined in [RFC2616], Section 2.2>
在我看来,这意味着可以将 JWT 保存在 Cookie 中,但是当我继续阅读时,我没有找到有关此字段的文档。同样在Wikipedia,我没有找到这个字段。
我的观点是错的还是?或者是否可以将 JWT(JWE、JWS)保存在 cookie 中?因为在PHP set_cookie()-Method 上我也找不到这个“令牌”字段。或者将令牌保存在 cookie 中并将 JWT 设置为 set_cookie()-Method 的值也是最佳做法?
【问题讨论】:
标签: php http-headers jwt setcookie rfc6265