private class HtmlUnitOptions implements Options {
public void addCookie(Cookie cookie) {
Page page = lastPage();
if (!(page instanceof HtmlPage)) {
throw new UnableToSetCookieException("You may not set cookies on a page that is not HTML");
}
String domain = getDomainForCookie();
verifyDomain(cookie, domain);