- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我遇到了用户在填写申请表时丢失 session 数据的问题。看来他们在申请表中途丢失了 session 状态。 (ASP.NET 4.0 WebForms 项目,IIS 6.0)
session 存储在状态服务器的进程外,因此它不是配置更改、应用程序域回收等 AFAIK。
<sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" timeout="20" />
我正在使用表单例份验证,滑动过期工作正常,您可以从下面的日志记录中看到 - 您可以看到票证过期时间是正确的,并且按预期延长。
<authentication mode="Forms">
<forms loginUrl="~/Login.aspx" />
</authentication>
我启用了一些自定义日志记录来尝试追踪此问题。每 Session_Start
火灾global.asax
我会记录一些内容,每次有人加载申请表或单击“下一步”在各部分(在多 View 中)之间移动时,我也会记录一些内容,因为他们浏览应用程序表单。
以下是人们失去 session 状态的两个示例。日志以日志条目的日期/时间开始,然后是一些措辞。括号中的第二个日期/时间(在措辞之后)是源自 CType(ctx.User.Identity, FormsIdentity).Ticket.Expiration.ToString
的 FormsAuthentication cookie 的到期日期/时间。
日志记录还记录用户的 IP 地址和 session ID。在将它们粘贴到此处之前,我已将其删除,我可以确认所有日志条目的 IP 地址和 session ID 都是相同的。
示例1:
**[26/10/2010 13:07] Session started []**[26/10/2010 13:11] Application form first Page_Load [26/10/2010 13:31:19][26/10/2010 13:13] App form next clicked, current index is 1 (vwSection1) [26/10/2010 13:31:19][26/10/2010 13:14] App form next clicked, current index is 2 (vwSection2) [26/10/2010 13:31:19][26/10/2010 13:15] App form next clicked, current index is 3 (vwSection3) [26/10/2010 13:31:19][26/10/2010 13:20] App form next clicked, current index is 5 (vwSection4) [26/10/2010 13:31:19][26/10/2010 13:20] App form next clicked, current index is 6 (vwSection5) [26/10/2010 13:31:19][26/10/2010 13:20] App form next clicked, current index is 7 (vwMonitoring) [26/10/2010 13:31:19][26/10/2010 13:21] App form next clicked, current index is 8 (vwInformation) [26/10/2010 13:31:19][26/10/2010 13:22] Application form first Page_Load [26/10/2010 13:41:22][26/10/2010 13:25] App form next clicked, current index is 1 (vwSection1) [26/10/2010 13:41:22][26/10/2010 13:26] App form next clicked, current index is 2 (vwSection2) [26/10/2010 13:41:22][26/10/2010 13:26] App form next clicked, current index is 3 (vwSection3) [26/10/2010 13:41:22][26/10/2010 13:28] App form next clicked, current index is 5 (vwSection4) [26/10/2010 13:41:22][26/10/2010 13:28] App form next clicked, current index is 6 (vwSection5) [26/10/2010 13:41:22][26/10/2010 13:28] App form next clicked, current index is 7 (vwMonitoring) [26/10/2010 13:41:22][26/10/2010 13:28] App form next clicked, current index is 8 (vwInformation) [26/10/2010 13:41:22]**[26/10/2010 13:28] Session started [26/10/2010 13:41:22]**[26/10/2010 13:31] Application form first Page_Load [26/10/2010 13:51:24][26/10/2010 13:31] App form next clicked, current index is 1 (vwSection1) [26/10/2010 13:51:24][26/10/2010 13:32] App form next clicked, current index is 2 (vwSection2) [26/10/2010 13:51:24][26/10/2010 13:32] App form next clicked, current index is 3 (vwSection3) [26/10/2010 13:51:24][26/10/2010 13:32] App form next clicked, current index is 5 (vwSection4) [26/10/2010 13:51:24][26/10/2010 13:32] App form next clicked, current index is 6 (vwSection5) [26/10/2010 13:51:24][26/10/2010 13:32] App form next clicked, current index is 7 (vwMonitoring) [26/10/2010 13:51:24][26/10/2010 13:32] App form next clicked, current index is 8 (vwInformation) [26/10/2010 13:51:24]
Example 2:
**[24/10/2010 17:44] Session started []**[24/10/2010 17:50] Application form first Page_Load [24/10/2010 18:10:13][24/10/2010 18:00] App form next clicked, current index is 1 (vwSection1) [24/10/2010 18:20:40]**[24/10/2010 18:07] Session started [24/10/2010 18:20:40]**[24/10/2010 18:08] App form next clicked, current index is 2 (vwSection2) [24/10/2010 18:20:40][24/10/2010 18:10] App form next clicked, current index is 2 (vwSection2) [24/10/2010 18:20:40][24/10/2010 18:10] App form next clicked, current index is 1 (vwSection1) [24/10/2010 18:30:42][24/10/2010 18:10] App form next clicked, current index is 1 (vwSection1) [24/10/2010 18:30:52][24/10/2010 18:10] App form next clicked, current index is 1 (vwSection1) [24/10/2010 18:30:58][24/10/2010 18:12] Application form first Page_Load [24/10/2010 18:31:35][24/10/2010 18:12] App form next clicked, current index is 1 (vwSection1) [24/10/2010 18:31:35][24/10/2010 18:13] App form next clicked, current index is 2 (vwSection2) [24/10/2010 18:31:35][24/10/2010 18:13] App form next clicked, current index is 2 (vwSection2) [24/10/2010 18:31:35][24/10/2010 18:16] App form next clicked, current index is 3 (vwSection3) [24/10/2010 18:31:35][24/10/2010 18:16] App form next clicked, current index is 5 (vwSection4) [24/10/2010 18:31:35][24/10/2010 18:17] App form next clicked, current index is 6 (vwSection5) [24/10/2010 18:31:35][24/10/2010 18:18] App form next clicked, current index is 7 (vwMonitoring) [24/10/2010 18:31:35][24/10/2010 18:18] App form next clicked, current index is 8 (vwInformation) [24/10/2010 18:31:35]
You can see in the first example that the session originally started at 13:07 but was also started at 13:28.
You can see in the second example that the session originally started at 17:44 and was restarted at 18:07.
I understand that these times are 20 minutes after the session started. But the session was not idle. You can see it was not idle because of the rest of the log. Clicking "Next" in the application form gets something an object out of session state
Dim m As Member = StateManager.CurrentMember
然后获取/设置“m”的属性。
所以,对我来说,即使用户没有空闲并访问他们的 session 变量,他们仍然会在开始后 20 分钟丢失 session 。请注意,在我的基本页面(所有页面均继承自该基本页面,基本页面继承 System.Web.UI.Page)中,我现在已开始将当前毫秒写入 session 状态,因此我不断写入 session 。
用户正在丢失 session 状态,因为 StateManager.CurrentMember(即 HttpContext.Current.Session("CurrentMember")
)返回 null。当我尝试将其附加到 Entity Framework 数据上下文时,这会给出未处理的异常 - 因此用户会看到我的通用错误处理页面。
任何想法表示赞赏。
最佳答案
您提到您正在使用 FormsAuthentication。您是否将滑动过期属性设置为 true?
http://msdn.microsoft.com/en-us/library/1d3t3c61(v=VS.100).aspx
关于asp.net - session 在 20 分钟后过期 : Whether idle or not,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4024208/
我有一个奇怪的问题。根据像this这样的帖子我希望 IDLE 比在命令行上运行我的代码慢。然而,我看到完全相反的情况。 该程序比较两个文件并将匹配行配对在一起并将所有匹配项写入新文件。我认为它类似于
我使用 emacs-24.5.1 浏览了 linux 内核代码,并使用 cedet(内联在 emacs 中)进行语义解析。 经过一些常规配置后,我用emacs打开init/main.c,出现了“Par
我写的字符串很长。为了便于阅读,我想将文本换行到多行。这是怎么做到的。我以前看过说明,但现在找不到了。 最佳答案 [这个答案一般适用于 Python,并不特定于 IDLE。] 对于没有嵌入换行符的长字
是否有任何现有的网络应用程序可以让多个用户同时使用交互式 IDLE 类型 session ? 类似于: IDLE 2.6.4 Morgan: >>> letters = list("abcdefg")
我是编程新手,我决定先学Python,所以; 我安装了 Python,最新版本 3.4。我正在尝试打开 Python IDLE(GUI) 模式,所以当我打开时,我收到消息“IDLE 的子进程没有建立连
最近很多用户发现system idle process占用率特别高,不知道什么意思,想要解决它。这个只是显示电脑剩余内存的,下面来看看想想的介绍吧。 system idle process占用率高
默认的 ATL 简单对象在其 IDL 文件的顶部具有以下内容: import "oaidl.idl"; import "ocidl.idl"; 这些文件有什么用,我怎么知道什么时候需要导入它们?是否有
这个问题在这里已经有了答案: How to clear the interpreter console? (30 个答案) 关闭 9 年前。 我正在运行一个脚本,该脚本使用的模块会在屏幕上打印很多内
这里 TP_DSCVoyChange 类有 KEY_DSC作为一个属性,我们要填充此 KEY_DSC 使用 TP_DSCVoyChange 使用 String 值从 Java 获取值构造函数。例如。
在我的 Mac 上,我通过自制软件安装了 python 3.9。 我尝试启动空闲并收到此错误: > idle3 ** IDLE can't import Tkinter. Your Python ma
我正在使用 this用于检测用户在我的应用程序中是否空闲的库。我正在使用 StartWatching(),在 onTimerStart 中,我现在只是打印控制台。 当用户空闲 N 秒时,onTimer
我们有一个 .NET 程序集(实际上是 Aspose.Words),我们希望客户端能够轻松地从 COM 客户端使用它。 因此,我们随程序集提供了 .TLB,以便客户端可以通过 C++ 或 Delphi
在之前的函数中,我创建并返回了一个哈希值。执行此操作后,它将哈希作为结构返回,我将其用作此以下函数的输入。 myStruct 的每个标签都是一个结构,每个都有一个名称和数据类型标签。 我正在尝试遍历每
假设我创建了以下 IDL 文件: module ProviderTest { interface Multiplier { long twice(in long number)
我有一个IDL文件,我使用scipy中的readsav将其导入Python,我更改了文件中的参数,我想将其导出/保存回原始格式,IDL可读。 这就是我导入它的方式: from scipy.io.idl
我正在尝试替换/删除文本文档中的一些行。该文档采用 ISO-8859-1 字符编码。 当我尝试将此行复制到我的 Python 脚本中进行替换时,它不会匹配。如果我缩短该行并删除直到第一个双引号 "它将
我的 Espresso 测试在 Espresso 版本 2.2.2 上运行良好,但是当我将我的工作室更新到最新版本并应用迁移规则时,测试将失败并需要更新版本。 库使用 androidTestImple
2013 年 4 月 15 日决议。 在 Windows 7(64 位)Windows 资源管理器中,当我右键单击 Python 文件并选择“使用 IDLE 编辑”时,编辑器会正确打开,但是当我运行(
我用的是3.8.10版本的Python.(32位)。我正在尝试在IDLE中导入NumPy包,但是我收到了这个消息。图像。我的Idle崩溃了,并显示以下信息。同样的事情也发生在其他包上,比如:Chain
IDL是什么意思?我用谷歌搜索了一下,发现它代表接口(interface)定义语言,用于组件的接口(interface)定义。但是,在实践中,IDL 的目的是什么?微软使用它吗? 最佳答案 接口(in
我是一名优秀的程序员,十分优秀!