code: private static Map<String, String> splitCookieToken(String tokenStr) {
      Map<String, String> map = new HashMap<String, String>();
      StringTokenizer st = new StringTokenizer(tokenStr, COOKIE_ATTR_SEPARATOR);
  
      while (st.hasMoreTokens()) {
        String part = st.nextToken();
        int separator = part.indexOf(COOKIE_KEY_VALUE_SEPARATOR);
        if (separator == -1) {
          LOG.error("Invalid token string " + tokenStr);
          return null;
        }
        String key = part.substring(0, separator);
        String value = part.substring(separator + 1);
        map.put(key, value);
      }
      return map;
    }
docs: Splits the cookie token into attributes pairs.
  @param str input token.
  @return a map with the attribute pairs of the token if the input is valid.
  Else, returns null.