private void addCookiesFromCookieStore(HttpURLConnection httpURLConnection) {
    if (LoggingCookieStore.INSTANCE.getCookiesMap().size() > 0) {
      List<String> cookiesStrList = new ArrayList<>();
      for (Map.Entry<String, String> entry : LoggingCookieStore.INSTANCE.getCookiesMap().entrySet()) {
        cookiesStrList.add(String.format("%s=%s", entry.getKey(), entry.getValue()));
      }
      httpURLConnection.setRequestProperty(COOKIE_HEADER, StringUtils.join(cookiesStrList, "; "));
    }
  }
Convenience class to handle the connection details of a LogSearch query request.
ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java