The system-wide CookieHandler is read and stored in the sun.net.www.http(s) HttpClient/HttpsClient instance. Since this HttpClient/HttpsClient instance is cached and reused (where possible) as part of the persistent/keep-alive connection implementation, it will not reflect any changes made to the default system-wide CookieHandler after it is created.

It is unspecified what effect changing the system-wide CookieHandler will have on the HTTP Client, but is seems reasonable that the two parts of the HTTP Client implementation, HttpURLConnection and HttpClient, should use the same CookieHandler. HttpClient should use the instance specific (most recently retrieved system-wide CookieHandler) from HttpURLConnection.

http://cr.openjdk.java.net/~chegar/7129083/webrev.00/webrev/

-Chris.

Reply via email to