This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "HTTPClient - cookie problem" Watch "HTTPClient - cookie problem" New topic
Author

HTTPClient - cookie problem

Lee Lowder
Greenhorn

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
Greenhorn

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.
 
wood burning stoves
 
subject: HTTPClient - cookie problem
 
Similar Threads
unique session for every tabs of browser window
Jmeter Login problems - update
Cookies not getting stored in IE6 and IE7 when running in environment resembling production
session tracking
Using common-httpclient 2.0 with axis 1.2 beta