Y
yofnik
Hello All,
I am going crazy trying to figure out why my ASP.NET web application
cannot get beyond the login screen. It is using very simple Forms based
authentication:
if(!FormsAuthentication.Authenticate(tbUserName.Value,
tbPassword.Value))
{
pageInfo.Text = "Invalid user name or password. Please try again.";
}
else
{
FormsAuthentication.RedirectFromLoginPage(tbUserName.Value, false);
}
If the username and password are wrong, the Authentication fails as
expected and the error message is displayed. If the credentials are
correct, the Redirect does not happen and it returns to the login page.
After turning Tracing on, I noticed that the authentication cookie is
not getting saved. It gets created after the Login POST, but then the
next page, the cookie is gone. Where in my development environment, the
cookie gets created and remains on every page thereafter.
I have seen this questions in a few other posts, but none of them had
an answer. Why does the Authentication Cookie go away after the login
page? Can anyone please help!
Thanks in advance.
I am going crazy trying to figure out why my ASP.NET web application
cannot get beyond the login screen. It is using very simple Forms based
authentication:
if(!FormsAuthentication.Authenticate(tbUserName.Value,
tbPassword.Value))
{
pageInfo.Text = "Invalid user name or password. Please try again.";
}
else
{
FormsAuthentication.RedirectFromLoginPage(tbUserName.Value, false);
}
If the username and password are wrong, the Authentication fails as
expected and the error message is displayed. If the credentials are
correct, the Redirect does not happen and it returns to the login page.
After turning Tracing on, I noticed that the authentication cookie is
not getting saved. It gets created after the Login POST, but then the
next page, the cookie is gone. Where in my development environment, the
cookie gets created and remains on every page thereafter.
I have seen this questions in a few other posts, but none of them had
an answer. Why does the Authentication Cookie go away after the login
page? Can anyone please help!
Thanks in advance.