Commit bfa38981 by sjtucc

loginout delete all cookies

parent 5af6e7b7
...@@ -128,6 +128,7 @@ public class LoginController extends BaseController { ...@@ -128,6 +128,7 @@ public class LoginController extends BaseController {
public String logOut() { public String logOut() {
LogManager.me().executeLog(LogTaskFactory.exitLog(ShiroKit.getUser().getId(), getIp())); LogManager.me().executeLog(LogTaskFactory.exitLog(ShiroKit.getUser().getId(), getIp()));
ShiroKit.getSubject().logout(); ShiroKit.getSubject().logout();
deleteAllCookie();
return REDIRECT + "/login"; return REDIRECT + "/login";
} }
} }
...@@ -84,6 +84,18 @@ public class BaseController { ...@@ -84,6 +84,18 @@ public class BaseController {
} }
/** /**
* 删除所有cookie
*/
protected void deleteAllCookie() {
Cookie[] cookies = this.getHttpServletRequest().getCookies();
for (Cookie cookie : cookies) {
Cookie temp = new Cookie(cookie.getName(), "");
temp.setMaxAge(0);
this.getHttpServletResponse().addCookie(temp);
}
}
/**
* 返回前台文件流 * 返回前台文件流
* *
* @author fengshuonan * @author fengshuonan
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment