ASPNET会议每年损失回传,刚刚在Firefox [英] aspnet session lost every postback, just in firefox

查看:108
本文介绍了ASPNET会议每年损失回传,刚刚在Firefox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以长话短说,在Chrome或IE浏览器,我可以在我的web应用程序点击刷新我的心内容和会话保持。在Firefox中我失去了我的每一个会话回发(该Session_End中方法被称为在Global.asax中)。

So long story short, in Chrome or IE I can hit refresh on my web app to my hearts content and the session remains. In Firefox I lose my session every postback (the Session_End method is called in Global.asax).

有什么建议?显然,这听起来像一个浏览器配置的问题......但我看不到任何会导致此行为。

Any suggestions? This obviously sounds like a browser configuration issue...but I can't see anything that would cause this behavior.

更新:

因此​​,原来这是我的code用来处理被关闭浏览器。出于某种原因,在Firefox中window.onunload事件被炒鱿鱼每一个岗位背面(即要求结束了会话的方法)。现在我要弄清楚为什么Firefox是表现这样。每天我都喜欢Firefox少!

So it turns out it was my code which handles the browser being closed. For some reason in Firefox the window.onunload event is getting fired every post back (which called a method which ended the session). Now I have to figure out why Firefox is behaving like that. Everyday I like firefox less!

更新2:
原来使用的Firefox中记载onunload的是行为,而Chrome仅仅是用它什么,仍然在调查更聪明,但作为回答,我会庆祝这个问题。

Update 2: Turns out using onunload is behaving as documented in firefox, but Chrome is just smarter with it or something, still investigating, but i'll mark this question as answered.

推荐答案

我想确保你没有的在Firefox中的cookie禁用。根据MSDN的 ASP.NET会话状态概述

I'd make sure that you don't have cookies disabled in Firefox. According to MSDN's ASP.NET Session State Overview:

默认情况下,SessionID的值存储在cookie中。

By default, SessionID values are stored in a cookie.

这篇关于ASPNET会议每年损失回传,刚刚在Firefox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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