django - Consistent user authorization across url with/without www -
i need clarify fundamental concept (beginner here).
in django web app maintain, notice if 1 logs in via going example.com
, they remain logged out on www.example.com
(and can go on create clone account).
1) why happen?
2) what's standard practice iron out issue? i.e., give 1 consistent experience across www
, no-www
.
in case answer basic redirection, use pointers , illustrative example there - i'm using nginx reverse proxy gunicorn.
1 ) django cookies not work same prepended www , non-www domain default.django considers different sessions.
2) prepend_www setting can set redirect xyz.com www.xyz.com.
prepend_www = true
or if need same cookie both of sites can use session_cookie_domain,
session_cookie_domain = ".yoursite.com"
Comments
Post a Comment