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