IE8和放大器; ASP.Net窗体打开多个浏览器时,身份验证Cookie失败 [英] IE8 & ASP.Net Forms Authentication Cookies fail when opening multiple browsers

查看:149
本文介绍了IE8和放大器; ASP.Net窗体打开多个浏览器时,身份验证Cookie失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下登录页面上的code。我使用这个设置由客户登录超时。在IE8我遇到,如果用户打开另一个浏览器窗口,然后注销在第一个窗口,当他们重新登录回到他们得到一个页面(每次)后反弹到登录的问题。如果他们不打开另一个浏览器,一切都很好。

我发现关于这个问题了很多,但我发现的唯一的解决方案,工作原理是利用无cookie的方法(URI)。

我已经看到了一些文章说要设置域名,这是我正在做,但不起作用。另外,我已经试过authticket设置为持久性和非持久性。无论是作出了区别。我所看到的,一旦身份验证cookie被从文件夹中消失了,它不得到,当我登录重新创建。

如果我打开第二个浏览器窗口为新建会话我没有任何问题。 (这是不实际的,因为我们不能在应用程序打开任何其他窗口这样的每个用户训练。)

是否有此修复程序,任何人发现,不包括使用Cookie的URI的方式?

  INT timeoutValue = 20 //这个值实际上是从一个方法返回;的FormsAuthenticationTicket authTicket =新的FormsAuthenticationTicket(LoginControl.UserName,假的,timeoutValue);
字符串的encryptedTicket = FormsAuthentication.Encrypt(authTicket);的HttpCookie authCookie =新的HttpCookie(FormsAuthentication.FormsCookieName,encryptedTicket中);
authCookie.Domain =my.domain;
authCookie.Expires = DateTime.Now.AddMinutes(timeoutValue);HttpContext.Current.Response.Cookies.Add(authCookie);


解决方案

这一个Internet Explorer中的功能的跨浏览器窗口共享饼干/会话。
因此,新的功能来创建一个IE8新建会话。
因此,我不相信有容易停止该行为的任何理想的方式。

除了将当然无Cookie。

I have the code below on a login page. I'm using this to set the login timeout by customer. In IE8 I'm running into the problem that if a user opens another browser window, then logs out in the first window, when they relog back in they get bounced back to the login after a single page (every time). If they don't open another browser, everything is fine.

I've found ALOT of questions about this, but the only solution I've found that works is to use the cookieless method (URI).

I've seen a few articles saying to set the domain, which I'm doing, but that doesn't work. Also, I've tried setting the authticket to both persistent and non-persistent. Neither has made a difference. I have seen that once the auth cookie is gone from the folder, it doesnt get recreated when I log in.

If I open that second browser window as a "New Session" I don't have any problems. (This isn't practical as we cant train every user of the app to open any additional windows this way.)

Is there a fix for this that anyone has found that doesn't involves using the cookieless URI approach?

int timeoutValue = 20 // This value is actually returned from a method;

FormsAuthenticationTicket authTicket = new FormsAuthenticationTicket(LoginControl.UserName, false, timeoutValue);            
string encryptedTicket = FormsAuthentication.Encrypt(authTicket);

HttpCookie authCookie = new HttpCookie(FormsAuthentication.FormsCookieName, encryptedTicket);                 
authCookie.Domain = "my.domain";
authCookie.Expires = DateTime.Now.AddMinutes(timeoutValue);

HttpContext.Current.Response.Cookies.Add(authCookie);

解决方案

This a "feature" of Internet Explorer to share cookies/session across browser windows. Hence the new "feature" to create a "New Session" in IE8. Therefore I do not believe there is any ideal way of easily stopping this behaviour.

Other than going cookieless of course.

这篇关于IE8和放大器; ASP.Net窗体打开多个浏览器时,身份验证Cookie失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆