public static String appendCookie(String cookies, String newCookie) {
    if (cookies == null || cookies.length() == 0) {
      return newCookie;
    }
    return cookies + "; " + newCookie;
  }
Utility method to append a new cookie value to an existing list of cookies.

@param cookies    the semicolon separated list of cookie values
@param newCookie  a new cookie value to be appended.

@return the new list of cookie values
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/URLStreamProvider.java