// Does not look like a valid expiry date
}
}
if (isNetscapeCookie) {
headerElements = new HeaderElement[] {
new HeaderElement(header.toCharArray())
};
} else {
headerElements = HeaderElement.parseElements(header.toCharArray());
}
Cookie[] cookies = new Cookie[headerElements.length];
for (int i = 0; i < headerElements.length; i++) {
HeaderElement headerelement = headerElements[i];
Cookie cookie = null;
try {
cookie = new Cookie(host,
headerelement.getName(),
headerelement.getValue(),
defaultPath,
null,
false);
} catch (IllegalArgumentException e) {
throw new MalformedCookieException(e.getMessage());
}
// cycle through the parameters
NameValuePair[] parameters = headerelement.getParameters();
// could be null. In case only a header element and no parameters.
if (parameters != null) {
for (int j = 0; j < parameters.length; j++) {
parseAttribute(parameters[j], cookie);