退出登录清除单点session的cookie

This commit is contained in:
shuzheng 2017-02-06 23:49:54 +08:00
parent f88763d56c
commit 019e2fea46
1 changed files with 3 additions and 2 deletions

View File

@ -211,14 +211,15 @@ public class SSOController {
/**
* 退出登录
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/logout", method = RequestMethod.GET)
public String logout(HttpServletRequest request) {
public String logout(HttpServletRequest request, HttpServletResponse response) {
// shiro退出登录
SecurityUtils.getSubject().logout();
// 清除单点sessionId
CookieUtil.getCookie(response, ZHENG_UPMS_SERVER_SESSION_ID);
CookieUtil.removeCookie(response, ZHENG_UPMS_SERVER_SESSION_ID);
String sessionId = CookieUtil.getCookie(request, ZHENG_UPMS_SERVER_SESSION_ID);
// 当前全局会话sessionId