How to get session time out message using Spring security

前端 未结 5 1510
悲哀的现实
悲哀的现实 2020-12-10 16:41

I want to get the session time out message when the session expires.Below is my spring-security.xml



        
5条回答
  •  孤街浪徒
    2020-12-10 17:19

    I suggest you to logout using this:

    HttpSession session= request.getSession(false);
        SecurityContextHolder.clearContext();
            if(session != null) {
                session.invalidate();
            }
            for(Cookie cookie : request.getCookies()) {
                cookie.setMaxAge(0);
            }
    

提交回复
热议问题