LoginSignup
1
1

More than 3 years have passed since last update.

chrome80でSameSite=Noneを明記しないといけなくなった問題、djangoユーザーはみんなどうしてるんだろう。

Posted at

背景

ウェブサイトの所有者は、ほかのサイトで使用可能なサードパーティCookieに明示的な属性を追加することを義務付けられるようになります。
参考:https://digiday.jp/platforms/what-is-chrome-samesite/

django側の対応

django/http/response.py
def set_cookie(self, key, value='', max_age=None, expires=None, path='/',
                   domain=None, secure=False, httponly=False, samesite=None):
...
  if samesite:
    if samesite.lower() not in ('lax', 'none', 'strict'):
      raise ValueError('samesite must be "lax", "none" or "strict".')
    self.cookies[key]['samesite'] = samesite
...

参考:https://github.com/django/django/commit/b33bfc383935cd26e19a2cf71d066ac6edd1425f#diff-eeebc8cb56240caf13a9952431189fef

けど、これ最新の3.0.2に入ってない

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1