In the applet mode, passing Set-Cookie2 header to CookieHandler.getDefault().put() appears to have no effect. See the attached example.
The example applet constructs a map of HTTP headers as follows:
Map<String, List<String>> headers =
new HashMap<String, List<String>>();
headers.put("Set-Cookie2", Arrays.asList("x=0"));
and passes it to:
handler.put(uri, headers);
The applet then immediately calls handler.get(uri, ...) and expects the result to include the cookie previosuly set with Set-Cookie2, but in my experiments that turns out to not be the case.
From the com.sun.deploy.net.cookie.DeployCookieSelector.put() method source code it follows that only "Set-Cookie" headers are supported. This seems odd because the javadoc for java.net.CookieHandler.put() explicitly mentions "Set-Cookie2".
This issue causes http://javafx-jira.kenai.com/browse/RT-15676