【发布时间】:2020-03-02 05:58:00
【问题描述】:
如何在 Python 2.7 中将 SameSite 参数添加到 cookie?
我已经看到了这个How do I set the `SameSite` attribute of HTTP cookies in python?,但我不清楚这是否适用于 Python 2.7,或者我什至如何将它与我拥有的代码结合起来:
response.set_cookie(key="", value="", max_age="", expires="", path="/",domain="",secure=None,httponly=True)
return response
我使用 Django,所以我像这样创建响应:
response = render(request, "template.html", {})
【问题讨论】: