本文介绍了使会话无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于 jsp servlet 的应用程序,会话时间超过 30 分钟,我想在有人有意或无意关闭浏览器窗口时立即使会话无效(操作系统关闭/从 tast 管理器关闭/关机)

I have a jsp servlet based application, with session time out of 30 mins, I want to invalidate the session as soon as a person closes the browser window intentionally or accidentally (OS shutdown/close from tast manager/powerdown)

我可以对此进行检查并使会话无效吗?

Can I put a check for that and invalidate the session?

推荐答案

无法处理这种情况.

有些浏览器提供此设置作为他们的首选项,但您无法以编程方式处理此设置.

There are some browsers which provide this setting as their preference , but you can't handle this programitically.

最大:

您可以在连接关闭后立即从与 gmail 中的 gtalk 相同的页面(可能是标题)进行投票.

You can make a poll from page(may be header) same as gtalk in gmail as soon as connection closes wipe that session out.

这篇关于使会话无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 08:21