p. 268: In the second paragraph change "can set include" to "can include".
p. 271: In Example 8-11, the matches()
method should also check the domain. That is, it should read:
public boolean matches(URI u) {
if (isExpired()) return false;
String path = u.getPath();
if (path == null) path = "/";
String domain = u.getHost();
if (path.startsWith(this.path)
&& domain.equals(thisdomain)) {
return true;
}
return false;
}
In fact, this isn't quite good enough because we also need to handle the case where a cookie for the domain example.com should apply to a request from foo.example.com and bar.example.com. I'll leave that as an exercise for the reader.