I have a Java application (JDK 1.7.0_13) and am using java.net.HttpURLConnection to connect to some servlet based services that do session management. I am trying to figure
I run your code and replace this
CookieHandler.setDefault(new CookieManager());
by
CookieHandler.setDefault( new CookieManager( null, CookiePolicy.ACCEPT_ALL ) );
It work!