Reputation: 387
How can we make Django use the same session on different URLs like app.example.com, example.com and www.example.com?
Upvotes: 3
Views: 619
Reputation: 3169
You need to add SESSION_COOKIE_DOMAIN
parameter to your settings
SESSION_COOKIE_DOMAIN = '.example.com'
The domain to use for session cookies. Set this to a string such as ".lawrence.com" (note the leading dot!) for cross-domain cookies, or use None for a standard domain cookie.
Upvotes: 3