getSession() always creates a new session
问题 We have SecurityFilter class in our application by implementing Filter and our doFilter method looks like this. public void doFilter(ServletRequest sres, ServletResponse sreq, FilterChain chain) throws IOException, ServletException { LOGGER.debug(Logger.buildLogMessage("Starting SecurityFilter.doFilter")); HttpServletRequest request = (HttpServletRequest) sres; HttpServletResponse response = (HttpServletResponse) sreq; HttpSession session = request.getSession(); We have the following entry in