-
Bug
-
Resolution: Not an Issue
-
P3
-
7u51
1) Create a URL to a simple JSP (say HelloWorld.jsp) deployed in Web Server
that maintains session (say TomCat).
2) Create a CookieManager which accepts all cookies as given below:
CookieManager manager = new CookieManager ();
manager.setCookiePolicy(CookiePolicy.ACCEPT_ALL);
CookieHandler.setDefault(manager);
3) ReadResponse
- Open connection and read response headers and body from the
URLConnection.
- Write the response headers/body to the console.
- We find that Set-Cookie header has empty value.
4) Repeat step #3
Note: Please find MyCookieTest.java (attached) executing the above steps.
Observation
===========
From the response of step #3, we find that Set-cookie header has an empty
value. However, from the contents of the CookieStore we find that the
JSESSIONID cookie is stored (as expected).
From the response of step #4, we find that Set-cookie header is absent and
the session is maintained ( as expected).
Test Files
==========
Please find the test case MyCookieTest.java and HelloWorld.jsp attached.
that maintains session (say TomCat).
2) Create a CookieManager which accepts all cookies as given below:
CookieManager manager = new CookieManager ();
manager.setCookiePolicy(CookiePolicy.ACCEPT_ALL);
CookieHandler.setDefault(manager);
3) ReadResponse
- Open connection and read response headers and body from the
URLConnection.
- Write the response headers/body to the console.
- We find that Set-Cookie header has empty value.
4) Repeat step #3
Note: Please find MyCookieTest.java (attached) executing the above steps.
Observation
===========
From the response of step #3, we find that Set-cookie header has an empty
value. However, from the contents of the CookieStore we find that the
JSESSIONID cookie is stored (as expected).
From the response of step #4, we find that Set-cookie header is absent and
the session is maintained ( as expected).
Test Files
==========
Please find the test case MyCookieTest.java and HelloWorld.jsp attached.
- relates to
-
JDK-7095980 Ensure HttpURLConnection (and supporting APIs) don't expose HttpOnly cookies
-
- Closed
-