I set up a website to use SqlMembershipProvider as written on this page.
I followed every step. I have the database, I modified the Web.config to use this provider, with the correct connection string, and the authentication mode is set to Forms. Created some users to test with.
I created a Login.aspx and put the Login control on it. Everything works fine until the point that a user can log in.
I call Default.aspx, it gets redirected to Login.aspx, I enter the user and the correct password. No error message, nothing seems to be wrong, but I see again the Login form, to enter the user's login information. However if I check the cookies in the browser, I can see that the cookie with the specified name exists.
I already tried to handle the events by myself and check, what is happening in them, but no success.
I'm using VS2008, Website in filesystem, SQL Express 2005 to store aspnetdb, no role management, tested with K-Meleon, IE7.0 and Chrome.
Any ideas?
Resolution: After some mailing with Rob we have the ideal solution, which is now the accepted answer.
I do not like the hack given.
I have a site that uses a login form called "login.aspx" and all works fine. I think we should actually find the answer rather than hack. Since all the [presumably] tested sites work. Do you not think we should actually use StackOverflow to find the ACTUAL problem? (making it much more useful than anywhere else?)
In the LoginCtl_Authenticate event are you setting the EventArgs.Authenticated property to true?
e.g.
protected void LoginCtl_Authenticate(object sender, AuthenticateEventArgs e)
{
// Check the Credentials against DB
bool authed = DAL.Authenticate(user, pass);
e.Authenticated = authed;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With