Re: FormsAuthentication Fails
From: Caroline Bogart (ctbogart_at_yahoo.com)
Date: 06/22/03
- Previous message: Caroline Bogart: "Re: FormsAuthentication Fails"
- In reply to: Matjaz Ladava: "Re: FormsAuthentication Fails"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
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);
- Previous message: Caroline Bogart: "Re: FormsAuthentication Fails"
- In reply to: Matjaz Ladava: "Re: FormsAuthentication Fails"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|