views:

283

answers:

2

Any idea why LoginControl requires users authenticate twice with FireFox but works correctly (once) with IE? I am using a custom MembershipProvider and RoleProvider, if that matters.

Authentication portion of my web.config;

<authentication mode="Forms">
      <forms
          timeout="50000000"
          protection="All"
          requireSSL="false"
          slidingExpiration="true"
          cookieless="AutoDetect"
          domain=""
          enableCrossAppRedirects="true">
        <credentials passwordFormat="SHA1" />
     </forms>        
</authentication>

Membership section;

 <membership defaultProvider="CustomMembershipProvider">
  <providers>
   <add 
    name="CustomMembershipProvider" 
    type="CustomCrateMembershipProvider" 
    connectionString="" 
    enablePasswordRetrieval="false" 
    enablePasswordReset="true" 
    requiresQuestionAndAnswer="true" 
    applicationName="/" 
    requiresUniqueEmail="true" 
    passwordFormat="Hashed" 
    maxInvalidPasswordAttempts="5" 
    minRequiredPasswordLength="5" 
    minRequiredNonalphanumericCharacters="1" 
    passwordAttemptWindow="10" 
    passwordStrengthRegularExpression=""/>
  </providers>
 </membership>
 <roleManager defaultProvider="CustomRoleProvider" enabled="true">
  <providers>
   <add name="CustomRoleProvider" type="CustomRoleProvider"/>
  </providers>
 </roleManager>

Only code behind related to login;

protected void OnLoggedIn(object sender, EventArgs e)
{
}

protected void OnLoggingOut(object sender, EventArgs e)
{
}
+1  A: 

Hmmm... It does seem odd that it would work in IE but not in Firefox.

Try adding this to your forms-settings:

loginUrl="~/Login.aspx" defaultUrl="default.aspx"
Stefan
I found I had a log method being called in the page (yea I know I moved it to code behind) it seems to access "Request.ServerVariables["REMOTE_ADDR"];" trigger anything? If I take this out then the double (with the additions you mentioned) works fine.
CmdrTallen
Removed the "REMOTE_ADDR" portion and added forms-settings suggested by Stefan and works now. Thanks.
CmdrTallen
Cool. Glad that I could help.
Stefan
+1  A: 

This has been driving me mad for the last couple of hours - resolved by changing the timeout in web.config to a larger value, e.g. from 30 to 30000

craig
Thank you - we had a problem where Chrome and IE both refused to authenticate and Firefox worked fine. We'd been trying a few options, increasing the timeout value worked for us.
Darren