Code example for MalformedCookieException

0
        if (host.contains(".")) {
            int domainParts = new StringTokenizer(domain, ".").countTokens();
 
            if (isSpecialDomain(domain)) {
                if (domainParts < 2) {
                    throw new MalformedCookieException("Domain attribute \""
                        + domain 
                        + "\" violates the Netscape cookie specification for " 
                        + "special domains"); 
                } 
            } else { 
                if (domainParts < 3) {
                    throw new MalformedCookieException("Domain attribute \""
                        + domain 
                        + "\" violates the Netscape cookie specification"); 
                }             
            } 
        } 
    } 
 
   /**