python SimpleCookie 区分错误
当我使用 python SimpleCookie 对象从 http 标头中获取 cookie 时,出现一些异常:
cookiestr = "a_em=[BU]co|12345678-901234567[DG]; Expires=Sat, 31 Dec 2016 17:09:50 GMT; Domain=.somesite.com; Path=/"
C = Cookie.SimpleCookie()
C.load(cookiestr)
print C
输出为:
Set-Cookie: a_em=; Domain=.somesite.com; expires=Sat,; Path=/
cookie 值和 cookie 过期时间错误!
我应该如何解决这个问题?
When i use python SimpleCookie object to pick up cookie from http headers, some exception occurs:
cookiestr = "a_em=[BU]co|12345678-901234567[DG]; Expires=Sat, 31 Dec 2016 17:09:50 GMT; Domain=.somesite.com; Path=/"
C = Cookie.SimpleCookie()
C.load(cookiestr)
print C
the output is:
Set-Cookie: a_em=; Domain=.somesite.com; expires=Sat,; Path=/
the cookie value and the cookie expires time is error!
how should i solve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
过期的 RFC 格式应为:
完整字符串应为(注意引号)
RFC format for expires should be:
The full string should be (note quotes)