code: public static String getUrlWithoutSessionId(String url, String sessionIdName) {
  
          if (isSessionEncodedInUrl(url, sessionIdName)) {
              return url.substring(0, url.indexOf(getSessionIdSubstring(sessionIdName)));
          }
          return url;
      }
docs: Returns the URL without the session encoded into the URL.
  
  @param url
  the url to de-code
  @param sessionIdName
  the name of the session ID, e.g. jsessionid
  @return url without session id information or url, if no session was
  encoded into the URL