M
Michael Groeger
Hi,
I have implemented a simple page for FormsAuthentication and when user data
is accepted I redirect the user using
FormsAuthentication.RedirectFromLoginPage().
private void btnLogin_Click(object sender, System.EventArgs e)
{
// [...]
FormsAuthentication.RedirectFromLoginPage(username, false);
}
The application the user enters has a logout button, which calls
Session.Abandon() and FormsAuthentication.SignOut() when clicked and then
redirects the user to the main page of the application, which causes the
login page to show up again.
private Page_Load(object sender, System.EventArgs e)
{
Session.Abandon();
FormsAuthentication.SignOut();
Response.Redirect("main.aspx");
}
So far so good, when I now enter the application with the same user again,
everything works fine, but when I try to login another user, I always get
back to the login page. I also tried to do login by hand, but with the same
effect:
private void btnLogin_Click(object sender, System.EventArgs e)
{
// [...]
FormsAuthentication.SetAuthCookie(username, false);
string url = FormsAuthentication.GetRedirectUrl(username, false);
Response.Redirect(url);
}
So what am I doing wrong here?
Regards,
Michael
I have implemented a simple page for FormsAuthentication and when user data
is accepted I redirect the user using
FormsAuthentication.RedirectFromLoginPage().
private void btnLogin_Click(object sender, System.EventArgs e)
{
// [...]
FormsAuthentication.RedirectFromLoginPage(username, false);
}
The application the user enters has a logout button, which calls
Session.Abandon() and FormsAuthentication.SignOut() when clicked and then
redirects the user to the main page of the application, which causes the
login page to show up again.
private Page_Load(object sender, System.EventArgs e)
{
Session.Abandon();
FormsAuthentication.SignOut();
Response.Redirect("main.aspx");
}
So far so good, when I now enter the application with the same user again,
everything works fine, but when I try to login another user, I always get
back to the login page. I also tried to do login by hand, but with the same
effect:
private void btnLogin_Click(object sender, System.EventArgs e)
{
// [...]
FormsAuthentication.SetAuthCookie(username, false);
string url = FormsAuthentication.GetRedirectUrl(username, false);
Response.Redirect(url);
}
So what am I doing wrong here?
Regards,
Michael