【发布时间】:2020-08-26 11:29:20
【问题描述】:
这是我的jsp页面
在标题中我放了这个
<head>
<META Http-Equiv="Cache-Control" Content="no-cache">
<META Http-Equiv="Pragma" Content="no-cache">
<META Http-Equiv="Expires" Content="0">
</head>
<body>
<a href="logout">LogOut</a></li>
<input type="hidden" id="fullname" name="fullname" value="${fullname}" >
</body>
这是我的控制器方法
@RequestMapping(value="/logout", method= RequestMethod.GET)
public ModelAndView logout(HttpServletRequest request , HttpServletResponse response, String fullname) {
ModelAndView mav = new ModelAndView();
HttpSession session = request.getSession();
session.removeAttribute(fullname);
session.invalidate();
mav.addObject("logout", true);
mav.setViewName("Home2");
return mav;
}
但在按下后退按钮后,我再次被重定向到登录页面。
【问题讨论】:
-
这能回答你的问题吗? How to end the session in spring 3
-
请使用会话无效
-
@saifali 我在我的控制器方法中使用了 session.invaldiate,
-
在其他控制器中进行会话检查或进行过滤以检查要处理的会话路径
标签: java spring spring-mvc jsp servlets