解决方案 »

  1.   

    你这也太麻烦了吧,服务端session就有过期功能啊,难道我理解错了。
      

  2.   

    Session是在登陆的时候写入,然后超时的时候清空吗?
      

  3.   

    信息不足无法判断,建议监听一下http响应
      

  4.   

    var strUrl = "Customer/TimeOver?time="+Math.random;你写的是相对地址啊还有cookie的过期时间js可以直接取到没必要用轮询
      

  5.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>js读取cookie测试</title>
    <link href="css/08nzfh-style.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    <!--
    .STYLE1 {color: #FF0000}
    -->
    </style>
    </head><body><div class="personality">
    <script type="text/javascript">
    //<![CDATA[
    function   setCookie(name,value) 

        var   Days   =   30;   //此   cookie   将被保存   30   天 
        var   exp     =   new   Date();         //new   Date( "December   31,   9998 "); 
        exp.setTime(exp.getTime()   +   Days*24*60*60*1000); 
        document.cookie   =   name   +   "= "+   escape(value)   + ";expires= "+   exp.toGMTString(); 
    } function getCookie2(objName){//获取指定名称的cookie的值
       var arrStr = document.cookie.split("; ");
       for(var i = 0;i < arrStr.length;i ++){
        var temp = arrStr<i>.split("=");
        if(temp[0] == objName) return unescape(temp[1]);
       } 
    }var _b = false;
    //setCookie("mycookie","mycookie");
     if(typeof(getCookie2("mycookie2"))   !=   'undefined')   
     {   
       alert(typeof(getCookie2("mycookie2")));
       _b = true; 
     } 
     alert(_b);
     if(_b){
      document.write('<iframe id="iframe_email" name="iframe_email" frameborder="0" scrolling="no" src="http://localhost:8008/vote1.4/test_8.jsp" height="100%" width="100%"></iframe>');
     }else{
      document.write('<iframe src="#" style="display:none;"></iframe> 请登录');
     } 
    //]]>
    </script>