File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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.
It is sorta covered in the JavaRanch Style Guide.
subject: HTTPClient - cookie problem
It's not a secret anymore!