I have a w2k3 server which hosts 2 sites under iis, such that I have Mysite.com and foo.mysite.com
I am trying to use forms authentication and single sign on.
Both sites have the same machine key, and the same domain prefixed with a . in the web.configs.
The 2 issues I have are;
1) If I go to http://www.mysite.com/login.aspx, and login, then navigate to the subdomain it redirects me back to the login page.
But if I go to http://mysite.com/login.aspx and login, then navigate to the subdomain it works. so why is it seeing www.mysite.com and mysite.com as seperate domains and thus invalidating my authentication?
It is my understanding that adding domain=".mysite.com" would work for all sub sites under the domain.
2) If I change the subdomain logi开发者_运维知识库n url to be mysite.com not www.mysite.com and hit the subdomain first, it redirects to the login form fine, but when I log in it does not redirect to the subdomain, rather it looks for the subdomain page on the main site. i.e. Browse to foo.mysite.com/bar.aspx, it redirects to the login page, and when logged in it now tries to show mysite.com/bar.aspx not the page I first requested.
Any help explaining and resolving these issues is most welcome!
Thanks
As an update to this. I found a workround to the redirect issue elsewhere on this site. Dont know why it doesnt work as I'd expect, but I can now cross that one off.
Secondly (on my test system anyway) programatically specifying the domain works with www. whereas using domain="" in teh config file does not.
Why specify the domain? Also, why not use config inheritance, this can work across app pools.
精彩评论