RFR 7129083: CookieManager does not store cookies if url is read before setting cookie manager

Michael McMahon michael.x.mcmahon at oracle.com
Mon Jan 16 08:03:54 PST 2012


On 16/01/12 11:39, Chris Hegarty wrote:
> 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.

Looks fine to me.

- Michael.



More information about the net-dev mailing list