【发布时间】:2012-08-31 10:36:22
【问题描述】:
您好,我正在使用 jsp/sevlet 在 Web 应用程序中工作,我正面临 iframe 中的会话注销页面问题
我在我的父页面中使用以下代码来解决我的会话超时
<script type="text/javascript">
idleTime = 0;
$(document).ready(function () {
//Increment the idle time 2ounter every minute.
var idleInterval = setInterval("timerIncrement()", 60000); // 1 minute
//Zero the idle timer on mouse movement.
$(this).mousemove(function (e) {
idleTime = 0;
});
$(this).keypress(function (e) {
idleTime = 0;
});
})
function timerIncrement() {
idleTime = idleTime + 1;
if (idleTime == 15) { // 15 minutes
window.location = "logoutPage.jsp"
}
}
</script>
我面临的问题是,如果一个进程在我的 iframe 页面中运行超出会话时间限制,那么父页面是 idel,因此它会自动注销
在其他情况下,如果我在 iframe 页面中使用会话超时代码,那么问题是
注销页面进入 iframe 页面
对于解开这个谜团有什么建议或其他解释吗? 请告诉我
【问题讨论】:
-
所以您不想在父/iframe 页面中复制此代码并且仍然能够实现目标?
-
在父/iframe 页面中复制此代码也会导致同样的问题
标签: java jquery jsp iframe session-timeout