Menu

#72 Provide API to enable single cookie header in http requests

SVN version
closed
nobody
None
5
2013-10-11
2005-02-06
No

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().

Discussion

  • David D. Kilzer

    David D. Kilzer - 2005-02-06

    Implements WebClient.setSingleCookieHeader(boolean)

     
  • Marc Guillemot

    Marc Guillemot - 2005-02-10

    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.

     
  • David D. Kilzer

    David D. Kilzer - 2005-02-11

    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)?

     
  • Marc Guillemot

    Marc Guillemot - 2005-02-14

    Logged In: YES
    user_id=402164

    Do you want to use 2 different cookie setting for the 2
    websites your testing on simultaneously?

     
  • David D. Kilzer

    David D. Kilzer - 2005-02-14

    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.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.