An API is needed to change the behavior of
commons-httpclient so that it will send cookies in a
single header rather than multiple headers. To wit:
http://sourceforge.net/mailarchive/message.php?msg_id=9752245
http://sourceforge.net/mailarchive/message.php?msg_id=10578977
The attached patch provides a getter/setter on
WebClient to set a property that will enable single
cookie headers on the HttpMethod object in
HttpWebConnection.makeHttpMethod().
Implements WebClient.setSingleCookieHeader(boolean)
Logged In: YES
user_id=402164
I'm not sure that it is a good idea to add it in webclient
because users can change it directly with something like:
DefaultHttpParams.getDefaultParams().setStringParameter(HttpMethodParams.SINGLE_COOKIE_HEADER,
Boolean.TRUE)
In a discussion in the mailing list for some times the end
point was that users should configure httpclient directly
rather than to provide shortcuts in webclient for all
possible settings that cookies have.
Logged In: YES
user_id=84089
Yes, I can see where adding get/set methods for all
commons-httpclient settings would become unwieldy.
I guess the only question I have, then, is will the
procedure for setting the default parameters work if you
have to access two different web sites within the same test
(JVM)?
Logged In: YES
user_id=402164
Do you want to use 2 different cookie setting for the 2
websites your testing on simultaneously?
Logged In: YES
user_id=84089
I'm asking about a hypothetical situation (hitting two web
sites and wanting two different cookie policies). In the
spirit of test-driven development, this is probably
premature design (since I don't really need it yet), but I
thought I'd ask the question anyway.
Please leave this ticket open until I can add something
useful to the wiki.
Logged In: YES
user_id=84089
Closing bug now that I wrote a wiki page describing the
solution.
http://htmlunit.sourceforge.net/phpwiki/index.php/SingleCookieHeader