Authenticating a user for a single app with multiple domains
- by hofnarwillie
I have one asp.net web application, but two different domains point to this web app. For instance: www.one.com and www.two.com both point to the same web app.
I have an issue where I need certain pages to be on a specific domain (due to some security requirements from our online payment provider - a third party website). So let's say page1.aspx needs to be called on www.two.com
The process is as follows:
A user logs into www.one.com
The authentication cookie is saved to the browser
The user then navigates to page1.aspx and, if on the wrong domain, gets redirected to the correct domain. (this redirection happens on page1.aspx in the page_load event)
Then asp.net redirects the user to the login screen, because the authentication cookie is not sent to www.two.com.
How can I track the user and keep him/her logged in between the two domains?