当我在Windows 7中使用IE10时,FormsAuthentication.SetAuthCookie在IIS 6.0中不起作用。 我使用Fiddler来监控cookie,我发现在IIS 6.0和IE10中,它没有设置cookie。
测试用例结果:
页面代码很简单:
protected void Page_Load(object sender, EventArgs e)
{
System.Web.Security.FormsAuthentication.SetAuthCookie("Demo", false);
感谢。
答案 0 :(得分:0)
当您的请求到达客户端时,您设置了auth cookie。确保您没有任何可能强制asp.net运行时重定向到错误页面的错误。
此外,response.Redirect可能会导致问题。