The issue was caused by using http://localhost:8000
instead of http://127.0.0.1:8000
. Switching to http://127.0.0.1:8000
fixed the problem, as localhost and 127.0.0.1 are treated as different domains by the browser, causing cookies and sessions to not be shared.