How can I solve the "Cookie csrftoken will be soon rejected because it has the sameSite attribute set to none" warning on my Django 2.0 application?

Viewed 837

I am using version 2.0 and I just noticed on my firefox developer tools this message:

Cookie “csrftoken” will be soon rejected because it has the “sameSite” attribute set to “none” or an invalid value.

It seems that django 2.0 does not store SameSite attribute along with this cookie.

(for example something like this: Set-Cookie: CookieName=CookieValue; SameSite=Lax;)

Is there a workaround for this? Or am I doing something wrong?

1 Answers

I'm working with an old Django 1.8 system, but simply updating the CSRF_COOKIE_SECURE value to True in my settings.py file resolved the warning for me.

Check the docs for more info.

Related