Persistent cookies not working

The public knowledge pool and discussion forum of the OWS community. Do not post confidential information here!
ptai
Posts: 13
Joined: 13 Aug 2020, 14:50

Persistent cookies not working

Post by ptai »

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:

Code: Select all

CookieHandler.setDefault(new CookieManager());
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:

Code: Select all

Set-Cookie: data=IDXyzlr63olM5hL;Expires=Sun, 13-Sep-2020 13:40:56 GMT
Does anyone have an idea how to fix this or can give me a hint what I am missing?

ptai
Posts: 13
Joined: 13 Aug 2020, 14:50

Re: Persistent cookies not working

Post by ptai »

After further research I now understand how it worked with Oracles webstart. They provided an implementation for the cookie store (session and persistent). The persistent store used the same format and place on disc as the IE to store the cookies.

As OWS does not seem to provide a cookie store, setting the default cookie store as I described above therefore only provides a temporary session store.

So the question is reduced to the following: Does OWS provide a persistent cookie store (I guess not ;)) or must one be provided?

Hendrik Ebbers

Re: Persistent cookies not working

Post by Hendrik Ebbers »

Hi ptai,

This issue is currently not part of our road map. Discussing such topic and finding a solution that will work for all OWS users can not be done as part of our free community support. We provide commercial support for OpenWebStart (https://openwebstart.com/support/) and even provide to work based on time & material. If this is an option for you please contact us at openwebstart@karakun.com
If you interested in discussing this issue you are more than welcome to join our free webinar next week: https://mailchi.mp/karakun/openwebstart-v12-faqsession

If this is not an option for you it is always possible to provide a Pull Request.

Thanks,
Hendrik

Janak Mulani
Posts: 726
Joined: 24 Mar 2020, 13:37

Re: Persistent cookies not working

Post by Janak Mulani »

OWS presently does not support persistent cookies. OWS works on Linux, Windows and Mac. So the solution when provided should work on all three platforms.

This issue has no priority for our current sponsors and we do not have the resources to implement this. Would you be interested in sponsoring this feature?

ptai
Posts: 13
Joined: 13 Aug 2020, 14:50

Re: Persistent cookies not working

Post by ptai »

I will for now just create a simple solution so our client is working again with cookies and OWS on Windows. For us a trivial extension of the CookieStore class is sufficient. We are currently not interested in sponsoring such a feature.

Post Reply