You're right, it would be valid for all subdomains. Hmm ... I can't see a solution without a hack. Eg: authenticate the user on agileamp.com and at the same time do a AJAX request to the subdomain's authentication clone.
This way the a cookie would be set only for the TLD (agileamp.com) and for the subdomain (whatever.agileamp.com). The two sessions would be different but I guess that's okay, right? Now that I think of it it would be simpler to make the session global and add the subdomain restriction to it. This way when the user visits a subdomain the first thing you do is to check the restriction in the session. Let us know what you come up with! Lucian On Wed, May 25, 2011 at 12:46 PM, tom <thomas.st...@gmail.com> wrote: > well, I thought about this, but wouldn't then the session be valid for > test.agileamp.com as well as for test2.agileamp.com? I want to set the > session only for test.agileamp.com (the subdomain where the account > belongs to). > > On 25 Mai, 10:30, Lucian Nicolescu <lucia...@gmail.com> wrote: >> I think you can use the SESSION_COOKIE_DOMAIN and set it up to >> ".agileamp.com" >> (docs:http://docs.djangoproject.com/en/dev/topics/http/sessions/#session-co...). >> >> Lucian >> >> >> >> On Tue, May 24, 2011 at 11:46 PM, tom <thomas.st...@gmail.com> wrote: >> > Hello, >> >> > I have a application, where I want that users log in to a special >> > subdomain. For example: The login screen is served atwww.agileamp.com >> > and the user is member of the account with subdomain >> > test.agileamp.com. >> >> > When the user logs in atwww.agileamp.com/login/I want to make sure, >> > that he gets the session cookie set for his accounts subdomain. >> > test.agileamp.com. >> >> > Any ideas? >> >> > regards, Tom >> >> > -- >> > 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 >> > django-users+unsubscr...@googlegroups.com. >> > For more options, visit this group >> > athttp://groups.google.com/group/django-users?hl=en. > > -- > 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 > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- 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 django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.