Commit e314d6c9 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin Committed by Hanno Schlichting

Update CHANGES.rst and add explenation on SameSite cookie

parent bc91440b
......@@ -15,6 +15,8 @@ Bugs Fixed
Features Added
++++++++++++++
- Add support to SameSite cookie in ``ZPublisher.HTTPBaseResponse``:
https://tools.ietf.org/html/draft-west-first-party-cookies-07
Restructuring
+++++++++++++
......
......@@ -642,6 +642,10 @@ class HTTPBaseResponse(BaseResponse):
# and block read/write access via JavaScript
elif name == 'http_only' and v:
cookie = '%s; HTTPOnly' % cookie
# Some browsers recognize the SameSite cookie attribute
# and do not send the cookie along with cross-site requests
# providing some protection against CSRF attacks
# https://tools.ietf.org/html/draft-west-first-party-cookies-07
elif name == 'same_site' and v:
cookie = '%s; SameSite=%s' % (cookie, v)
cookie_list.append(('Set-Cookie', cookie))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment