Commit 553226d3 by CHEN Committed by stylefeng

!42 你好,退出登录应该清空cookie

Merge pull request !42 from CHEN/guns-branch-for-pullrequest
parents 5af6e7b7 bfa38981
......@@ -128,6 +128,7 @@ public class LoginController extends BaseController {
public String logOut() {
LogManager.me().executeLog(LogTaskFactory.exitLog(ShiroKit.getUser().getId(), getIp()));
ShiroKit.getSubject().logout();
deleteAllCookie();
return REDIRECT + "/login";
}
}
......@@ -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
......
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