Found the answer,
The session middleware sets a cookie, using this code(http://
code.djangoproject.com/browser/django/trunk/django/contrib/sessions/
middleware.py )

42                      response.set_cookie(settings.SESSION_COOKIE_NAME,
request.session.session_key,
43                          max_age=max_age, expires=expires,
domain=settings.SESSION_COOKIE_DOMAIN,
44                          secure=settings.SESSION_COOKIE_SECURE or None)

Putting SESSION_COOKIE_DOMAIN = '.example.tld' in settings.py solves
the problem.


On Sep 17, 6:06 pm, shabda <[EMAIL PROTECTED]> wrote:
> If I have my site setup at example.tld and I have used the built in
> django authentication system,  any page at foo.example.tld (or any
> subdomain of example.tld) is not able to access the user. So if the
> view is accesed from a subdomain the login_required or other
> decorators fail. It looks to me that this could be because the cookies
> are set for example.com and not *.example.com.
> What can I do so that a logged in user is logged in from all
> subdomains?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to