}
public void setCookie(final String name, final String value, final Date expires) {
cachedCookies.put(name, value);
final Update update = new Update(objectID);
update.put(PROPERTY.ADD, Boolean.TRUE);
update.put(PROPERTY.NAME, name);
update.put(PROPERTY.VALUE, value);
if (expires != null) {
update.put(PROPERTY.COOKIE_EXPIRE, expires.getTime());
}
Txn.get().getTxnContext().save(update);
}