简体   繁体   中英

In Django, how do I make my sessions persist through http://example.com and http://www.example.com?

If I set a session in example.com, it doesn't work on www.example.com . I'd like all subdomains, and all www, to be treated as one big thing.

example.com and all its subdomains should have all the session cookies of everything.

Do I change this in Apache2?

I found the solution:

SESSION_COOKIE_DOMAIN = ".example.com"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM