目前我已经阅读了 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 中,但是当我继续阅读时,我没有找到有关该字段的文档。同样在维基百科上我没有找到这个字段。
我的观点是错的还是?或者是否可以将 JWT(JWE、JWS)保存在 cookie 中?因为在 PHP set_cookie()-Method上我也找不到这个“令牌”字段。还是将令牌保存在 cookie 中并将 JWT 设置为 set_cookie()-Method 的值也是最佳做法?