Skip to content

Conversation

agriffis
Copy link

@agriffis agriffis commented Jun 26, 2024

I'm interacting with a server that likes to simultaneously expire a cookie and give it a new value in the same headers:

Set-Cookie: JSESSIONID=expire; Max-Age=0; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/
Set-Cookie: JSESSIONID=ED0E0934E642AC44A7ACDE6CED16D904; Path=/; Secure; HttpOnly

This isn't spec, as I understand it, but it turns out the browsers don't care. They just use the last value given.

So this PR updates httpie to behave in the same way, by ignoring an earlier expiration in favor of a later setting in the same headers.

Without this change, httpie drops the cookie rather than setting it, which makes interacting with this particular server quite difficult.

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

Successfully merging this pull request may close these issues.

2 participants