private void addCookiesToCookieStoreFromResponse(HttpURLConnection httpURLConnection) {
    Map<String, List<String>> headerFields = httpURLConnection.getHeaderFields();
    List<String> cookiesHeader = headerFields.get(SET_COOKIES_HEADER);
    if (cookiesHeader != null) {
      for (String cookie : cookiesHeader) {
        HttpCookie cookie1 = HttpCookie.parse(cookie).get(0);
        LoggingCookieStore.INSTANCE.addCookie(cookie1.getName(), cookie1.getValue());
      }
    }
  }
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