websphere 的 session 到期时间有多精确?
How precise is websphere's session expiration?
我们编写了一些 jquery 和 java 代码来支持将具有预期 session 过期时间的 cookie 传递给客户端,然后在两分钟前提示用户给他们有机会延长 session。如果他们未能及时这样做,他们将在下一个按钮点击时转到登录页面。
效果很好...大部分时间。每隔一段时间,试图测试这个的测试人员会在提示出现后等待 4 分钟,单击一个按钮只会发现他们的 session 仍然活着,尽管他们等待的时间比他们应该多等了整整 2 分钟session 去死。
规格是否在 session 到期时不够精确?我们是否应该把它吹掉,因为这没什么大不了的?我们使用 ibm 的 websphere 作为我们的应用程序服务器。
我假设您在服务器上将会话过期时间设置为两分钟。即,不是cookie过期时间。
会话应该在两分钟后过期。但是,如果应用程序(单击按钮)调用 getSession(true) 而不是 getSession(false),则会话可以在过期后恢复活动(但为空)。
如果不是这种情况,您能否启用会话跟踪:com.ibm.ws.session.*=all
WebSphere 有一个名为 HttpSessionReaperPollInterval 的设置来控制此行为。
Use this property to specify, in seconds, a wake-up interval for the
process that removes invalid sessions. The value specified for this
property overrides the default installation value, which is between 30
and 360 seconds, and ensures that the reaper process runs at a
specific interval.
虽然 属性 可以调整,但在您的场景中更改默认值可能仍然没有意义。
我们编写了一些 jquery 和 java 代码来支持将具有预期 session 过期时间的 cookie 传递给客户端,然后在两分钟前提示用户给他们有机会延长 session。如果他们未能及时这样做,他们将在下一个按钮点击时转到登录页面。
效果很好...大部分时间。每隔一段时间,试图测试这个的测试人员会在提示出现后等待 4 分钟,单击一个按钮只会发现他们的 session 仍然活着,尽管他们等待的时间比他们应该多等了整整 2 分钟session 去死。
规格是否在 session 到期时不够精确?我们是否应该把它吹掉,因为这没什么大不了的?我们使用 ibm 的 websphere 作为我们的应用程序服务器。
我假设您在服务器上将会话过期时间设置为两分钟。即,不是cookie过期时间。
会话应该在两分钟后过期。但是,如果应用程序(单击按钮)调用 getSession(true) 而不是 getSession(false),则会话可以在过期后恢复活动(但为空)。
如果不是这种情况,您能否启用会话跟踪:com.ibm.ws.session.*=all
WebSphere 有一个名为 HttpSessionReaperPollInterval 的设置来控制此行为。
Use this property to specify, in seconds, a wake-up interval for the process that removes invalid sessions. The value specified for this property overrides the default installation value, which is between 30 and 360 seconds, and ensures that the reaper process runs at a specific interval.
虽然 属性 可以调整,但在您的场景中更改默认值可能仍然没有意义。