Index: C:/Documents and Settings/Ortwin/My Documents/code/HttpClient-3/src/java/org/apache/commons/httpclient/cookie/RFC2109Spec.java =================================================================== --- C:/Documents and Settings/Ortwin/My Documents/code/HttpClient-3/src/java/org/apache/commons/httpclient/cookie/RFC2109Spec.java (revision 240197) +++ C:/Documents and Settings/Ortwin/My Documents/code/HttpClient-3/src/java/org/apache/commons/httpclient/cookie/RFC2109Spec.java (working copy) @@ -222,7 +222,11 @@ value = ""; } formatParam(buffer, new NameValuePair(cookie.getName(), value), version); - if (cookie.getDomain() != null + if ((cookie.getPath() != null) && cookie.isPathAttributeSpecified()) { + buffer.append("; "); + formatParam(buffer, new NameValuePair("$Path", cookie.getPath()), version); + } + if ((cookie.getDomain() != null) && cookie.isDomainAttributeSpecified()) { buffer.append("; "); formatParam(buffer, new NameValuePair("$Domain", cookie.getDomain()), version); @@ -227,10 +231,6 @@ buffer.append("; "); formatParam(buffer, new NameValuePair("$Domain", cookie.getDomain()), version); } - if (cookie.getPath() != null && cookie.isPathAttributeSpecified()) { - buffer.append("; "); - formatParam(buffer, new NameValuePair("$Path", cookie.getPath()), version); - } } /**