docs: protected boolean shouldReuseId(HttpServletRequest _request, SessionAffinityContext sac)
    {
      boolean reuseId = sac.isResponseIdSet() || sac.isRequestedSessionIDFromSSL();
      if (!reuseId)
      {
        if (_smc.getEnableUrlRewriting())
        {
          boolean useCookies = _smc.getEnableCookies() && _request.getHeader("Cookie") != null;
          if (!useCookies)
          { // Either the server doesn't support cookies, or we didn't get
            // any cookies from the client, so we have to assume url-rewriting.
            // Note that the client may indeed support cookies but we have no
            // way to know for sure.
            Object objSacHashtable = ((IExtendedRequest) _request).getSessionAffinityContext();
            Hashtable sacHashtable = (Hashtable) objSacHashtable;
            if (sacHashtable.size() > 1)
            { // multiple sacs on request -- can only happen if one or more apps
              // in dispatch
              // chain support cookies.
              Enumeration sacEnum = sacHashtable.elements();
              SessionAffinityContext otherSac;
              String otherResponseId;
              // look through sacs and take the first response id we find
              while (sacEnum.hasMoreElements())
              {
                otherSac = (SessionAffinityContext) sacEnum.nextElement();
                otherResponseId = otherSac.getResponseSessionID();
                if (otherResponseId != null)
                {
                  sac.setResponseSessionID(otherResponseId);
                  reuseId = true;
                  break;
                }
              }
            }
          }
        }
      }
      // We must check SessionManagerConfig.isIdReuse() at the end to ensure the
      // response id is
      // properly set in the current sac.
      return (reuseId || SessionManagerConfig.isIdReuse());
    }