清除session ,清除cookie

清除session

SysContent.getSession().invalidate(); //清除session

清除cookie

//清除cookie
		HttpServletRequest request = SysContent.getRequest();
		Cookie killcookie = CookieUtil.getCookieByName(request, "user");
		killcookie.setValue(null);
		killcookie.setMaxAge(0);
		killcookie.setPath("/");
		HttpServletResponse response = SysContent.getResponse();
		response.addCookie(killcookie);

猜你喜欢

转载自blog.csdn.net/weixin_39209728/article/details/83862864