code: private String getCookieParam(String param, String cookieString) {
          if (param.equals(NAME)) {
              return cookieString.substring(0, cookieString.indexOf('='));
          }
  
          if (param.equals(VALUE)) {
              if (cookieString.contains(";")) {
                  return cookieString.substring(cookieString.indexOf('=') + 1, cookieString.indexOf(';'));
              } else {
                  return cookieString.substring(cookieString.indexOf('=') + 1);
              }
          }
  
          if(containsFlag(SECURE, param, cookieString) || containsFlag(HTTP_ONLY, param, cookieString)) {
              return String.valueOf(true);
          }
  
          if (cookieString.contains(param + '=')) {
              final int endParam = cookieString.indexOf(';', cookieString.indexOf(param + '='));
              final int beginIndex = cookieString.indexOf(param + '=') + param.length() + 1;
              if (endParam > 0) {
                  return cookieString.substring(beginIndex, endParam);
              } else {
                  return cookieString.substring(beginIndex);
              }
          }
  
          throw new CitrusRuntimeException(String.format(
                  "Unable to get cookie argument '%s' from cookie String: %s", param, cookieString));
      }
docs: Extract cookie param from cookie string as it was provided by "Set-Cookie" header.
  @param param The parameter to extract from the cookie string
  @param cookieString The cookie string from the cookie header to extract the parameter from
  @return The value of the requested parameter