Change the ID of the session that this request is associated with. There are several things that may trigger an ID change. These include moving between nodes in a cluster and session fixation prevention during the authentication process. @param newSessionId The session to change the session ID for
(String newSessionId)
| 2417 | * @param newSessionId The session to change the session ID for |
| 2418 | */ |
| 2419 | public void changeSessionId(String newSessionId) { |
| 2420 | // This should only ever be called if there was an old session ID but |
| 2421 | // double check to be sure |
| 2422 | if (requestedSessionId != null && !requestedSessionId.isEmpty()) { |
| 2423 | requestedSessionId = newSessionId; |
| 2424 | } |
| 2425 | |
| 2426 | Context context = getContext(); |
| 2427 | if (context != null && |
| 2428 | !context.getServletContext().getEffectiveSessionTrackingModes().contains(SessionTrackingMode.COOKIE)) { |
| 2429 | return; |
| 2430 | } |
| 2431 | |
| 2432 | if (response != null && context != null) { |
| 2433 | Cookie newCookie = ApplicationSessionCookieConfig.createSessionCookie(context, newSessionId, isSecure()); |
| 2434 | response.addSessionCookieInternal(newCookie); |
| 2435 | } |
| 2436 | } |
| 2437 | |
| 2438 | |
| 2439 | @Override |
nothing calls this directly
no test coverage detected