This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes HTTPClient - cookie problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "HTTPClient - cookie problem" Watch "HTTPClient - cookie problem" New topic

HTTPClient - cookie problem

Lee Lowder

Joined: Apr 05, 2012
Posts: 6

I am currently trying to use HTTPClient 4.1.3 to try to login to an app.

It is mostly working well, but this app sets cookies based on certain groups, and some of these groups have spaces in the name.

This is resulting in cookies being set with spaces in the name. It works in a browser, but for some reason is not working in httpclient.

I am using compatibility mode for the cookies, and when I dump them to screen, I do see the full value I am expecting.

I am also seeing the full cookie value in the Apache logs when I enable that level of logging.

However, I am seeing a truncated version in the webapp's logging.

Is there a different cookie mode I need to use, or is there something I am missing perhaps?

Any ideas are appreciated.
Lee Lowder

Joined: Apr 05, 2012
Posts: 6

Just as an update.

I've determined that the problem is that httpclient is stripping quotes from the cookie value.

I'm currently trying to create a custom cookie spec to make it not do this, but having trouble with locating documentation to assist with this.

If anyone has any suggestions, or knows of any documents that are for httpclient 4.1.3, I would appreciate it.
jQuery in Action, 2nd edition
subject: HTTPClient - cookie problem