//session清除
session.invalidate();
//session检测 Users us = (Users) session.getAttribute("loginuser"); if (null != us) { java.util.Hashtable htb = (java.util.Hashtable) application.getAttribute("MemberList"); if(htb != null){ String loginid = (String) htb.get(us.getLoginid()); if (session.getId().equals(loginid)) { out.print(""); } else { session.removeAttribute("loginuser"); session.invalidate(); } } } //清除页面缓存,直接写页面上 response.setHeader("Cache-Control","no-store"); response.setHeader("Pragma","no-cache"); response.setDateHeader ("Expires", 0);
原文:http://www.cnblogs.com/Linger-wj/p/3985986.html