if (version == 1) {
put(buf, "$Version=\"1\"; ");
}
for (int i = 0; i < cookies.length; i++) {
final Cookie cookie = cookies[i];
put(buf, cookie.getName());
put(buf, "=");
// Servlet implementation does not check anything else
maybeQuote2(version, buf, cookie.getValue(), true);
// If version == 1 - add domain and path
if (version == 1) {
// $Domain="domain"
final String domain = cookie.getDomain();
if (domain != null) {
put(buf, "; $Domain=");
maybeQuote2(version, buf, domain, versionOneStrictCompliance);
}
// $Path="path"
String path = cookie.getPath();
if (path != null) {
put(buf, "; $Path=");
UEncoder encoder = new UEncoder();
encoder.addSafeCharacter('/');