1、session保存在服务器,客户端不知道其中的信息;cookie保存在客户端,服务器能够知道其中的信息。   
    
  2、session中保存的是对象,cookie中保存的是字符串。   
    
  3、session需要借助cookie才能正常工作。如果客户端完全禁止cookie,session将失效。

解决方案 »

  1.   

    我是这样处理的:
    request.getSession().invalidate();
    response.sendRedirect("xxx.html");xxx.html里写:
    <script type="text/javascript" language="javascript">
     alert("成功退出!")
    window.open('XX.html/xx.jsp','_top');
    </script>
      

  2.   

    <%
    session.removeAttribute("id");  //清空Session变量
    response.sendRedirect("index.jsp");
    %>
      

  3.   

     session.invalidate();
    是用后  将会使所有的 session  失效     所以一般是使用session.removeAttribute(".....");
      

  4.   

    应该是IE缓存问题,在页面上加入这样一段代码也许有用,代码如下:
    <%response.setHeader( "Cache-Control" , "no-cache" ); 
    //Forces caches to obtain a new copy of the page from the origin server 
    response.setHeader( "Cache-Control" , "no-store" ); 
    //Directs caches not to store the page under any circumstance 
    response.setDateHeader( "Expires" , 0); 
    //Causes the proxy cache to see the page as "stale" 
    response.setHeader( "Pragma" , "no-cache" ); %>