httpservletrequest - create new session / change session Id

后端 未结 2 1456
渐次进展
渐次进展 2020-12-24 06:11

I\'m maintaining a Java web application.

Looking into the login code it gets an HttpSession out of HttpServletRequest via the getSession() method of HttpServletReque

2条回答
  •  时光取名叫无心
    2020-12-24 06:26

    Since Java EE 7 and Servlet API 3.1 (Tomcat 8) you can use HttpServletRequest.changeSessionId() to achieve such behaviour. There is also a listener HttpSessionIdListener which will be invoked after each change.

提交回复
热议问题