Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid 'expires' attribute? #325

Closed
joelkuiper opened this issue Jun 23, 2016 · 14 comments
Closed

Invalid 'expires' attribute? #325

joelkuiper opened this issue Jun 23, 2016 · 14 comments

Comments

@joelkuiper
Copy link

ResponseProcessCookies:129 - Invalid cookie header: "Set-Cookie: ncbi_sid=73BE402676BBFF01_0927SID; domain=.nih.gov; path=/; expires=Fri, 23 Jun 2017 10:54:40 GMT". Invalid 'expires' attribute: Fri, 23 Jun 2017 10:54:40 GMT

When executing a GET I get this message, is it simply a server misconfiguration or something else going on?

@dakrone
Copy link
Owner

dakrone commented Jun 27, 2016

Do you have the full stack trace for this error?

@joelkuiper
Copy link
Author

joelkuiper commented Jun 29, 2016

Just shows up as a warning here, no stack trace

2016-06-29 15:33:31 WARN ResponseProcessCookies:129 - Invalid cookie header: "Set-Cookie: ncbi_sid=9DFD5C99773CE2B1_0917SID; domain=.nih.gov; path=/; expires=Thu, 29 Jun 2017 13:33:31 GMT". Invalid 'expires' attribute: Thu, 29 Jun 2017 13:33:31 GMT

Probably related https://issues.apache.org/jira/browse/HTTPCLIENT-1640

@dakrone
Copy link
Owner

dakrone commented Jul 3, 2016

Okay, since this is marked as fixed in 4.5, it should be fixed in the latest clj-http which uses a 4.5 version of the client.

What version of clj-http are you using? Does upgrading fix this?

@yang-wei
Copy link

Same problem here
using 3.1.0 of clj-http

@dakrone
Copy link
Owner

dakrone commented Oct 16, 2016

Has anyone had a chance to try this with clj-http 3.3.0?

@drewr
Copy link
Collaborator

drewr commented Nov 7, 2016

Confirm it still fails with 3.3.0:

Nov 06, 2016 9:19:57 PM org.apache.http.client.protocol.ResponseProcessCookies processCookies
WARNING: Invalid cookie header: "Set-Cookie: fr=0ZcB4dEGC2q4MqVrd..BYH_Ld.Am.AAA.0.0.BYH_Ld.AWXCoUKJ; Expires=Sun, 5 Feb 2017 02:49:38 GMT; Path=/; Version=0". Invalid 'expires' attribute: Sun, 5 Feb 2017 02:49:38 GMT

Tried turning up org.apache.http.client.protocol to TRACE but didn't get any more logging.

@eivindw
Copy link

eivindw commented Apr 26, 2017

Also still failing with the 3.5.0 version:

Apr 26, 2017 3:00:42 PM org.apache.http.client.protocol.ResponseProcessCookies processCookies
WARNING: Invalid cookie header: "Set-Cookie: user_id="2|1:0|10:1493211642|7:user_id|44:ZDQ0NmIxYmRjOTE0NDgxZjljNzFhZTMxNzBiYjkyZmU=|87307f9664bd33350c039cd1d5ecc3bb8782c68ec890ba4fde5150b57168cc12"; expires=Fri, 26 May 2017 13:00:42 GMT; Path=/". Invalid 'expires' attribute: Fri, 26 May 2017 13:00:42 GMT

@eivindw
Copy link

eivindw commented Apr 28, 2017

Overriding the cookie-policy on the request to "standard" fixed the problem for me - in case anyone else has the same problem:

  (client/post login-url
    {:body (ch/generate-string {"email" "..." "password" "..."})
     :content-type :json
     :cookie-policy :standard
     :cookie-store cs
     :headers {"x-xsrftoken" (get-token)}})

As suggested in this thread on stackoverflow.

@borkdude
Copy link

Confirmed, :cookie-policy :standard solves this.

@douglasoviche
Copy link

You guys saved me a lot of wasted time. I've been all afternoon after this answer.
Thanks very much

@dakrone
Copy link
Owner

dakrone commented Feb 27, 2018

I think I'm going to close this since there's a workaround for it (setting :cookie-policy :standard). Let me know if anyone disagrees and I'll re-open.

@eigenhombre
Copy link

eigenhombre commented May 22, 2019

@dakrone Might be worth adding a note in the README around the part where it explains how to set up the cookie store? Anyways, thanks for the workaround.

@conan
Copy link

conan commented Dec 19, 2022

I'm experiencing this issue, maybe needs another HttpClient bump? Looks like 5.1.3 is compliant (current version is 4.5.13)

https://stackoverflow.com/questions/36473478/fixing-httpclient-warning-invalid-expires-attribute-using-fluent-api/73764182#73764182

EDIT: we can use :cookie-policy :none if we aren't using cookies, which solved the issue for me. See comment in another issue about this

@dakrone
Copy link
Owner

dakrone commented Dec 19, 2022

I'd love to bump to 5.x, however, it's a very large change due to breaking changes between 4.x and 5.x, and I haven't had the time to be able to devote to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants