ASP.NET SetAuthCookie weird behaviour
- by rlb.usa
Hello SO,
I'm trying to do user impersonation for a web application we have. The user selects the user they'd like to emulate/impersonate and then clicks the button which fires this:
protected void uxImpersonate_Click(object sender, EventArgs e)
{
...
FormsAuthentication.SetAuthCookie(uxUserToEmulate.SelectedValue, false);
Response.Redirect("Impersonation.aspx"); //reload page manually
}
We have a dev - test - production server environment and on two servers this works just fine, but on another one, in all browsers, it kicks me to the login screen.
What's going on and how can I fix it?
We're on ASP.NET 2.0