public static String createCookieToken(String clientUserName) {
    StringBuilder sb = new StringBuilder();
    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 SecureRandom()).nextLong());
    return sb.toString();
  }
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 :
cu=&lt;username&gt;&amp;rn=&lt;randomNumber&gt;&amp;s=&lt;cookieSignature&gt;
service/src/java/org/apache/hive/service/auth/HttpAuthUtils.java