United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-7076837 : Passing Set-Cookie2 header to CookieHandler.getDefault().put() has no effect in applet mode

Details
Type:
Bug
Submit Date:
2011-08-09
Status:
Resolved
Updated Date:
2011-09-22
Project Name:
JDK
Resolved Date:
2011-08-17
Component:
deploy
OS:
generic
Sub-Component:
plugin
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6u24
Fixed Versions:
7u2 (b03)

Related Reports
Backport:

Sub Tasks

Description
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

                                    

Comments
EVALUATION

Add "Set-Cookie2" support in deployment code and update junit cookie test as well.
                                     
2011-08-12
PUBLIC COMMENTS

Well, I don't think this issue absolutely needs to be fixed for FX since a simple workaround seems to exist here. If I parse the code correctly, I can use "Set-Cookie" instead of "Set-Cookie2" to achieve the desired effect. I have already tried this workaround and confirmed that it solves my cookie problems. Unfortunately, it does not fully solve http://javafx-jira.kenai.com/browse/RT-15676, but that is probably unrelated to this issue. That said, I view this issue as a spec conformance problem only, not as a blocker for FX.
                                     
2011-08-09



Hardware and Software, Engineered to Work Together