session控制管理及js關閉瀏覽器銷燬session
阿新 • • 發佈:2019-02-16
//關閉瀏覽器銷燬Seesion
var xmlHttp;
function createXMLHttpRequest()
{
//IE
if (window.ActiveXObject)
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
//Other
else if (window.XMLHttpRequest)
{
xmlHttp = new XMLHttpRequest();
}
}
function destorySession()
{
try{
createXMLHttpRequest();
var url = "destorysession.jsp";
xmlHttp.open("POST", url, false);
xmlHttp.send(null);
var result = xmlHttp.responseText;
}
catch(e)
{
alert("銷燬Session異常!");
}
}
var xmlHttp;
function createXMLHttpRequest()
{
//IE
if (window.ActiveXObject)
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
//Other
else if (window.XMLHttpRequest)
{
xmlHttp = new XMLHttpRequest();
}
}
function destorySession()
{
try{
createXMLHttpRequest();
var url = "destorysession.jsp";
xmlHttp.open("POST", url, false);
xmlHttp.send(null);
var result = xmlHttp.responseText;
}
catch(e)
{
alert("銷燬Session異常!");
}
}