注销Session

况经纬
2023-12-01
/**
	 * 注销session
	 * 
	 * 
	 * @author zhangxuewei
	 * @param session
	 * @return
	 */
	@RequestMapping(value = "/logout",method=RequestMethod.GET)
	public String logout(HttpSession session) {
		logger.info("logout ...........");
		User user = (User) session.getAttribute("sessionUser");
		if (user.getUserName() != null) {
			session.removeAttribute("sessionUser");
		}
		return "login";

	}

 

 类似资料: