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 that works fine in my development environment:
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 and the application redirects back to the
login page because it thinks authentication should still occur. Where
in my development environment, the cookie gets created and remains on
every page thereafter and everything works fine.
I have seen this questions in a few other posts, but none of them had
an answer. What could cause the authentication cookie to not get saved?
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 that works fine in my development environment:
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 and the application redirects back to the
login page because it thinks authentication should still occur. Where
in my development environment, the cookie gets created and remains on
every page thereafter and everything works fine.
I have seen this questions in a few other posts, but none of them had
an answer. What could cause the authentication cookie to not get saved?
Can anyone please help!
Thanks in advance.