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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -