RFR 7129083: CookieManager does not store cookies if url is read before setting cookie manager
Chris Hegarty
chris.hegarty at oracle.com
Mon Jan 16 03:39:58 PST 2012
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.
More information about the net-dev
mailing list