title: Problem with asp.net forms authentication in internet explorer
body: <p>My company has a web application hosted on a client's machine that uses forms authentication in ASP.net.  When visiting the website <a href="http://www.client.com/Application" rel="nofollow noreferrer">http://www.client.com/Application</a> and trying to authenticate on the login page the user gets redirected back to the login page.  When accessing it via <a href="http://localhost/Application" rel="nofollow noreferrer">http://localhost/Application</a> the authentication works fine and the user is able to get into the site.  We cannot replicate this behavior in our development environment so we're pretty sure it has something to do with their server/environment.</p>
  
  <p>The problem only happens when using Internet Explorer (tested with ie 6, 7, 8).  When the client tries to get on with firefox, the authentication works fine.</p>
  
  <p>I created a debug page that the logon page redirects to after a call to FormsAuthentication.SetAuthCookie that displays information about the authentication cookie.  When hitting it in Internet Explorer, the authentication cookie does not exist.  When hitting it in FireFox it does.</p>
  
  <p>Has anyone encountered something like this before or have any suggestions about what could be the problem?</p>
  
  <p>EDIT:</p>
  
  <p>Web.config</p>
  
  <pre><code>&lt;authentication mode="Forms"&gt;
    &lt;forms name=".ASPXAUTH" loginUrl="Login.aspx" /&gt;
  &lt;/authentication&gt;
  &lt;authorization&gt;
    &lt;deny users="?" /&gt;
    &lt;allow users="*" /&gt;
  &lt;/authorization&gt;   
  
   &lt;!-- Page used to display authentication cookie information --&gt;
   &lt;location path="AuthDebugPage.aspx"&gt;
     &lt;system.web&gt;
       &lt;authorization&gt;
        &lt;allow users="?"/&gt;
       &lt;/authorization&gt;      
     &lt;/system.web&gt;
   &lt;/location&gt;
  </code></pre>
  
  <p>LogOn.aspx.vb</p>
  
  <pre><code>If (adAuth.IsAuthenticated(Domain, txtUserName.Text, txtPassword.Text)) Then          
  
    Dim AuthDebug As Boolean =      System.Configuration.ConfigurationSettings.AppSettings("AuthDebug")
  
    If AuthDebug Then
      FormsAuthentication.SetAuthCookie(SystemUserName, False)
      Response.Redirect("AuthDebugPage.aspx")
    Else
      FormsAuthentication.RedirectFromLoginPage(txtUserName.Text, False)
    End If
  End If 
  </code></pre>
  
  <p>The admin of their domain looked through the group policy to see if they were pushing anything down to their nodes that prevented users from accepting cookies on IE and he didn't find anything.  He also took a machine off the domain and cleaned it of all group policy and still had the same trouble authenticating in internet explorer.</p>