一次清除所有的session代码如下: Enumeration e = getSession().getAttributeNames(); while (e.hasMoreElements()) { String sessionName = (String) e.nextElement(); System.out.println("存在的session有:" + sessionName); getSession().removeAttribute(sessionName); } 相关文章: 2021-10-16 2021-04-05 2021-08-04 2022-12-23 2022-12-23 2022-12-23 2021-11-27