title: Can I cause a method to be triggered if the session ID is changed?
body: <p>We have a method triggered in case the session ID gets changed. This method essentially allows our logger to pick up the change as soon as it happens, so any logging output is now against the new session ID.</p>
  
  <p>In servlet API 3.0 and earlier we used <code>HttpSessionListener</code> whose <code>sessionCreated</code> method ran whenever the session ID was updated. This is because in 3.0 and earlier, the only way to change the session ID is to create a new session.</p>
  
  <p>Servlet API 3.1 introduced the <code>changeSessionId</code> method. This does not cause the session to be re-created, so the <code>HttpSessionListener</code> does not get called. However, it is another way to change the session ID. So is there any similar way to cause a method to be triggered in case the session ID is changed?</p>