MCPcopy Create free account
hub / github.com/apache/tomcat / changeSessionId

Method changeSessionId

java/org/apache/catalina/connector/Request.java:2419–2436  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 12

getContextMethod · 0.95
getServletContextMethod · 0.95
createSessionCookieMethod · 0.95
isSecureMethod · 0.95
getSessionInternalMethod · 0.95
rotateSessionIdMethod · 0.95
containsMethod · 0.65
getStringMethod · 0.65
getManagerMethod · 0.65
isEmptyMethod · 0.45

Tested by

no test coverage detected