Cookies which have expiration date in the format:
Thu, 01-Jan-1970 00:00:01 GMT (please note - the dashes which are present in the date string here) - yes, these cookies DO PARSE FINE, but when a cookie with an expiration date for example:
Mon, 25 Sep 2017 13:40:02 GMT (note - no dashes present in the date string) is received - fails to be parsed by the client.
For them the client display the following warning and does not parse them at all subsequently are not found at all in the list of cookies received from the page. Here the warning message that the client is displaying for the "cookie without dashes"
IX 26, 2016 11:16:16 AM org.apache.http.client.protocol.ResponseProcessCookies processCookies
WARNING: Invalid cookie header: "Set-Cookie: visid_incap_11422=lpcj4/RwRCeGBn9ortCgElXZ6FcAAAAAQUIPAAAAAAB7xml6KSoKB40cUgb90fbD; expires=Mon, 25 Sep 2017 13:40:02 GMT; path=/; Domain=.gotodrueckglueck.com". Invalid 'expires' attribute: Mon, 25 Sep 2017 13:40:02 GMT
In case it does not get clear enough: My question is: can I workaround this problem in apache http client without writing my own Set-Cookie headers parser ?
Or is it a problem at all ?
Anyone knows, please, thank you ?
I was able to fix this problem by adding
.setCookieSpec(CookieSpecs.STANDARD)
to the RequestConfig object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With