public void processHttpRequestMessage ( HttpMessage message ) { // Get the session tokens for this site HttpSessionTokensSet siteTokensSet = extension . getHttpSessionTokensSet ( getSite ( ) ) ; // No tokens for this site, so no processing if ( siteTokensSet == null ) { log . debug ( "No session tokens for: " + this . getSite ( ) ) ; return ; } // Get the matching session, based on the request header List < HttpCookie > requestCookies = message . getRequestHeader ( ) . getHttpCookies ( ) ; HttpSession session = getMatchingHttpSession ( requestCookies , siteTokensSet ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "Matching session for request message (for site " + getSite ( ) + "): " + session ) ; } // If any session is active (forced), change the necessary cookies if ( activeSession != null && activeSession != session ) { CookieBasedSessionManagementHelper . processMessageToMatchSession ( message , requestCookies , activeSession ) ; } else { if ( activeSession == session ) { log . debug ( "Session of request message is the same as the active session, so no request changes needed." ) ; } else { log . debug ( "No active session is selected." ) ; } // Store the session in the HttpMessage for caching purpose message . setHttpSession ( session ) ; } }
Process the http request message before being sent .