code: public static String createCookieToken(String clientUserName) {
      StringBuffer sb = new StringBuffer();
      sb.append(COOKIE_CLIENT_USER_NAME).append(COOKIE_KEY_VALUE_SEPARATOR).append(clientUserName)
        .append(COOKIE_ATTR_SEPARATOR);
      sb.append(COOKIE_CLIENT_RAND_NUMBER).append(COOKIE_KEY_VALUE_SEPARATOR)
        .append((new Random(System.currentTimeMillis())).nextLong());
      return sb.toString();
    }
docs: Creates and returns a HS2 cookie token.
  @param clientUserName Client User name.
  @return An unsigned cookie token generated from input parameters.
  The final cookie generated is of the following format :
  {@code cu=<username>&rn=<randomNumber>&s=<cookieSignature>}