Code example for CookieOrigin

Methods: getHost

0
            throw new IllegalArgumentException("Cookie may not be null");
        } 
        if (origin == null) {
            throw new IllegalArgumentException("Cookie origin may not be null");
        } 
        String host = origin.getHost();
        String domain = cookie.getDomain();
        if (domain == null) {
            throw new MalformedCookieException("Cookie domain may not be null");
        } 
        if (!domain.equals(host)) {
            int dotIndex = domain.indexOf('.');
            if (dotIndex == -1) {
                throw new MalformedCookieException("Domain attribute \"" 
                        + domain 
                        + "\" does not match the host \""  
                        + host + "\"");
            } 
            // domain must start with dot 
            if (!domain.startsWith(".")) {
                throw new MalformedCookieException("Domain attribute \""