title: Asp.net forms authentication and multiple domains
body: <p>I have two domains, domain1.com and domain2.com pointing at the same asp.net website which uses asp.net build in form authentication. The problem is that even if the domains point to the same website the user only get authenticated for one domain at a time. So if he uses www.domain1.com first and then visits www.domain2.com it's the same website in the back but he only is authenticated for www.domain1.com. The same thing happens if he uses www and not www when visiting the sites.</p>
  
  <p>This is what I use to login:</p>
  
  <pre><code>FormsAuthentication.RedirectFromLoginPage(username, cookie.Checked);
  </code></pre>
  
  <p>To check login:</p>
  
  <pre><code>User.Identity.IsAuthenticated
  </code></pre>
  
  <p>How can I make the user gets authenticated for all domains that points to the same website?</p>