public static Cookie createCookie(final String cookieName, final String cookieValue, final int validDays) {
public static Cookie createCookie(final String cookieName, final String cookieValue, final int validHours) {
    public static Cookie createCookie(final String cookieName, final String cookieValue, final int validDays) {        /* Validate parameters. */        if (cookieName == null || cookieName.equals("")) {            throw new IllegalArgumentException("cookieName must be a non-empty string.");        }        if (cookieValue == null || cookieValue.equals("")) {            throw new IllegalArgumentException("cookieValue must be a non-empty string.");        }        if (validDays < 0) {            throw new IllegalArgumentException("validDays must be a >= 0.");        }        Cookie cookie = new Cookie(cookieName, cookieValue);        cookie.setMaxAge(validDays * 24 * 60 * 60); // Days to seconds        cookie.setVersion(0);        return cookie;    }