code: static List<Cookie> parseCookieHeader(String host, String cookieHeaderValue) {
          if (StringUtils.isEmpty(cookieHeaderValue)){
              return Collections.emptyList();
          }
          String[] cookies = cookieHeaderValue.split(";");
          List<Cookie> cookiesList = new ArrayList<Cookie>();
          for (String cookie : cookies){
              String[] parts = cookie.split("=");
              //manage empty value
              if (parts.length==1) {
                  cookiesList.add(new Cookie(host,parts[0].trim(),""));
              }else{
                  cookiesList.add(new Cookie(host,parts[0].trim(),parts[1].trim()));
              }
          }
          return cookiesList;
       }
docs: Parse a cookie header to return a list of cookies.
  
  Unfortunatly the method Header.getElements() is not working properly.
  On a line like Cookie: has-js=1; drupal-toolbar=off it only returns the
  first element has-js=1. So we rework this one.
  
  This is a "won't fix" known issue as the project ended.
  https://issues.apache.org/jira/browse/HTTPCLIENT-1356
  
  @param host the host used to build the query, functionally not useful as we are on the client side of the proxy but the host is required by the constructor of the Cookie object
  @param cookieHeaderValue the string value of the cookie header, the part of the string after "Cookie: "
  @return a list of cookies corresponding to the list of name/value found in cookieHeaderValue