已签名 cookie 的验证因请求库而失败

Validation of signed cookie fails with request lib

我们的签名 cookie 实现适用于 Firefox、Chrome 和 IE。

我们使用 requests library 进行测试。

出于某种原因,请求库似乎更改了 cookie 数据。

我们像文档中那样使用会话:http://docs.python-requests.org/en/latest/user/advanced/

知道为什么图书馆会更改 cookie 数据吗?

并非所有字符都允许出现在 cookie 中。

https://github.com/kennethreitz/requests/issues/286

requests 更改了数据。

一个解决方案可能是存储 base64 编码的 cookie 数据。

相关:Allowed characters in cookies