【发布时间】:2013-03-16 15:36:11
【问题描述】:
我几天前提出了这个问题 (Java session deleted after page refresh),但没有得到答案。可能是因为问题出在 onbeforeunload 事件中。 与:
<body onbeforeunload="chiudi()">
我想对会话进行突击检查。问题是这样会话将是
如果用户刷新页面,也会被触发。我该如何解决?
这是我的 javascript 函数 chiudi()
function chiudi(){
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("POST", "SvuotaSession", false);
xmlHttp.setRequestHeader("Content-type",
"application/x-www-form-urlencoded");
xmlHttp.send(null);
}
【问题讨论】:
标签: javascript ajax refresh onbeforeunload page-refresh