Ok, here is the problem:
I have two sites: www.mysite.com and blog.mysite.com (fake site names) which suppose to share authentication. The login page is on www.mysite.com/login/login.aspx
Now, the blog website has web.config with following authentication section:
<authentication mode="Forms">
<forms timeout="50000000"
loginUrl="http://www.mysite.com/login/login.aspx"
defaultUrl="~/"/>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
Now I hit blog.mysite.com/andrey/page.aspx
and it redirects me to login page which is on www
site. The real problem is that "reditect" query string will only contain relative page url (andrey/page.aspx
), so when I login it will try to redirect me to www.mysite.com/andrey/page.aspx
, not blog.mysite.com/andrey/page.aspx
where i started so of course everything fails.
Is there a way to tell Membership object to put the full path into "redirect" query string parameter when it bounces to login page?
Thanks! Andrey