Fix: cross-origin session cookie not sent after upgrading to Django 3 (SESSION_COOKIE_SAMESITE)

2019-12-30 12:27 (6 years ago)
Fix: cross-origin session cookie not sent after upgrading to Django 3 (SESSION_COOKIE_SAMESITE)

By default, Django3 sets the following in its settings:

SESSION_COOKIE_SAMESITE = 'Lax'


This is the default configuration.

To disable it:

SESSION_COOKIE_SAMESITE = None

After making this change, either log out or clear your cookies and log in again.

Note that this will weaken security.

Categories

Archive