views:

24

answers:

1

I'm a Django beginner.

My site - let's call it abc.com - works fine, letting users log in and out (having originally registered via Django registratiaon). If it's relevant, my virtuahosts file has ServerName abc.com and ServerAlias www.abc.com directives.

I don't want my visitors to sense that both abc.com and www.abc.com exist, and so discovered Django's prepend_www setting, which works as intended. In addition to working as intended, however, there's a side effect that disables logging in and out when visiting the www. variant of my site.

A: 

In your settings.py try setting:

SESSION_COOKIE_DOMAIN = ".abc.com"

This will make the cookie apply to all the subdomains of abc.com.

Ned Batchelder
Awesome. Thanks Ned, very much appreciated. Cant upvote - no rep ;-(
ropz
No prob, @ropz. You can accept the answer, though, no?
Ned Batchelder