Is there any way to get raw response http header?
The getHeaderField() method doesn\'t work for me, because server spits multiple \'Set-Cookie\' and som
Late to the party, but here's the simplest solution. Just implement CookieStore. (or use the default implementation and let it take care of adding the cookies to your subsequent calls.)
http://docs.oracle.com/javase/7/docs/api/java/net/CookieStore.html
Set your cookie store as the default cookie manager
CookieManager cookieManager = new CookieManager(new MyCookieStore(), CookiePolicy.ACCEPT_ALL);
CookieHandler.setDefault(cookieManager);
And every new cookie will appear to you in add() in your CookieStore. I had the same problem with params being overwritten by having the same name "Set-Cookie" in a single request, and now I get both the cookie and the sessionId.