sessionname.getCreationTime()//得到创建的时间!
sessionname.getLastAccessedTime()//得到最近访问的时间这些够用了么!

解决方案 »

  1.   

    sessionname.setMaxInactiveInterval()
    //设置最大存在时间
    sessionname.getMaxInactiveInterval()//得到。。这下够了吧!!!
      

  2.   

    seesion还是比较节约资源的,一般没问题
    你不是要设为N个小时吧
      

  3.   

    session.getCreationTime()//得到创建的时间
    session.getLastAccessedTime()//得到最近访问的时间
    session.getMaxInactiveInterval()//获得默认的超期时间
    session.setMaxInactiveInterval()//设置改变超时间间隔在Tomcat上可以用 web.xml的<session-timeont>标签来定义session的超时间隔.
      

  4.   

    web.xml放在 web-inf下  <webapp>
        <session-config>
          <session-timeout>-1</session-timeout>
        </session-config>
      </webapp>
      

  5.   

    //session の使用期限のは確定する
            session.setMaxInactiveInterval(-1);
            其中-1 为时间无穷大
      

  6.   

    maximize the session period
      

  7.   

    不要用session,如果用户停留几个小时或几天,你的服务器不崩了才怪
    用js就行了!
      

  8.   

    在web.xml  <webapp>
        <session-config>
          <session-timeout>20</session-timeout>
        </session-config>
      </webapp>
      

  9.   

    shaopin(shaopin):  说说你怎么用JS??
      

  10.   

    给你一段简单的代码:
    <html>
    <form name="myform">
    <td vAlign="top" width="135">您在此停留了:
        <input name="clock" value="在线时间" size="this.length">
     </td>
    </form><script language="JavaScript">
    var id, iM = 0, iS = 1;
    start = new Date();
    function go()
    {
    now = new Date();
    time = (now.getTime() - start.getTime()) / 1000;
    time = Math.floor( time);
    iS = time % 60;
    iM = Math.floor( time / 60);
    if ( iS < 10)
    document.myform.clock.value = " " + iM + " 分 0" + iS + " 秒";
    else
    document.myform.clock.value = " " + iM + " 分 " + iS + " 秒";
    id = setTimeout( "go()", 1000);
    }
    go();
    </script></body>
    </html>