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 ( ) ; }
Creates and returns a HS2 cookie token .