Re: FormsAuthentication Fails

From: Caroline Bogart (ctbogart_at_yahoo.com)
Date: 06/22/03

  • Next message: Michele Leroux Bustamante: "Re: Protect a subfolder with form autehtication ?"
    Date: 22 Jun 2003 06:49:44 -0700
    
    

    To reduce suffering in others, here is the answer!

    When I removed the dot from the cookie name, it didn't work because I
    removed the dot (".cookie" to "cookie").

    It worked because the credentials had been stored in a persisted
    cookie which now bypassed authentication. By changing the cookie name,
    I forced re-authenticating the user, which subsequently called the
    login code that re-authenticated and redirected the page.

    In the code below, change the cookie persistence to your user's
    preference for "Remember me."

    Here's the model:

        <authentication mode="Forms" >
            <forms
                    name="ASPXAUTH1"
                    loginUrl="us/secure/login.aspx"
                    path="/"
            />
        </authentication>
        <authorization>
            <deny users="?" />
            <allow users="*" />
        </authorization>

    Click event of the login.aspx page:
    customerInfo.Email = txtEmail.Text.Trim();
    customerInfo.Password = txtPassword.Text.Trim();
    customerInfo.Encrypted = Utilities.Encrypt(customerInfo.Password);
    CustomerInfo.EmailStatus ems = customerInfo.EmailPasswordExists();
    if (ems == CustomerInfo.EmailStatus.ExistsGoodPassword)
    {
          this.LogHimIn();
    }
    else
    {
          lblTryAgain.Visible=true;
    }

    LogHimIn code:
    FormsAuthentication.RedirectFromLoginPage(customerInfo.CustomerID.ToString(),false);


  • Next message: Michele Leroux Bustamante: "Re: Protect a subfolder with form autehtication ?"

    Relevant Pages