[Answer]-Django cannot read session under subdomain but working under IP Address

0👍

The problem is a network issue, we are using Sophos, and after they changed url to https, all working fine.

👤Muke

1👍

You should add this line to your settings.py

SESSION_COOKIE_DOMAIN = ".yourdomain.com"

The domain to use for session cookies. Set this to a string such as
“.example.com” (note the leading dot!) for cross-domain cookies, or
use None for a standard domain cookie.

Django docs

Leave a comment