Persistent cookies not working
Posted: 13 Aug 2020, 15:57
When using OWS 1.1.8 to deploy our application (java 11.0.8), persistent cookies are not being stored or sent when doing an http 1.1 request from our application. With Oracles webstart, cookies have been persisted on disc (eg. on Windows 7 under "C:\Users\xxx\AppData\Roaming\Microsoft\Windows\Cookies") and were sent with each client request.
I noticed, that cookies set by the server will be sent back automatically on a subsequent request by the client (using an HttpUrlConnection), but only when a default-cookie handler is registered:
Using Oracles webstart, I did not have to do this.
But this still does not fix the persistence problem. Only cookies received during an active session will be automatically returned.
Here is an example of one of the cookies which is not persisted correctly:
Does anyone have an idea how to fix this or can give me a hint what I am missing?
I noticed, that cookies set by the server will be sent back automatically on a subsequent request by the client (using an HttpUrlConnection), but only when a default-cookie handler is registered:
Code: Select all
CookieHandler.setDefault(new CookieManager());
But this still does not fix the persistence problem. Only cookies received during an active session will be automatically returned.
Here is an example of one of the cookies which is not persisted correctly:
Code: Select all
Set-Cookie: data=IDXyzlr63olM5hL;Expires=Sun, 13-Sep-2020 13:40:56 GMT