}
public void setCookie(String name, String value) {
Cookie cookie = null;
if (value.indexOf(';') > 0) {
Spliterator it = new Spliterator(value, ";");
if (it.hasNext()) {
String realValue = it.nextString();
cookie = makeCookie(name, realValue);
while (it.hasNext()) {
String property = it.nextString().trim();
if (property.indexOf('=') > 0) {
Spliterator pit = new Spliterator(property, "=");
String pname = pit.hasNext() ? pit.nextString().trim() : "";
String pvalue = pit.hasNext() ? pit.nextString().trim() : "";
if ("path".equals(pname)) cookie.setPath(pvalue);
if ("ttl".equals(pname)) cookie.setMaxAge(IntegerNumberUtils.intValue(pvalue, 0));
}
}
}