时间:2021-07-01 10:21:17 帮助过:10人阅读
var x=0;
function myRefresh()
{
var httpRequest = new ActiveXObject("microsoft.xmlhttp");
httpRequest.open("GET", "test.aspx", false);
httpRequest.send(null);
x++;
if(x<60) //60次,也就是Session真正的过期时间是30分钟
{
setTimeout("myRefresh()",30*1000); //30秒
}
}
myRefresh();
在web.config中设置:
<sessionState mode="InProc" timeout="1"></sessionState>