Skip to content

Cookie max-age is wrong #70

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

Closed
slandelle opened this issue Mar 29, 2012 · 3 comments
Closed

Cookie max-age is wrong #70

slandelle opened this issue Mar 29, 2012 · 3 comments

Comments

@slandelle
Copy link
Contributor

Salut,

AsyncHttpProviderUtils.parseCookie sets a -1 max-age for both expired regular cookies and session cookies (that don't have a max-age).

max-age should be an Integer (set to null for session cookies) instead of an int, so that one can tell expired and session cookies apart.

Cheers,

Stephane

@jfarcand
Copy link
Contributor

Salut, do you have a server or test I can look at to see if the fix will works? I will look at the spec.... Thanks!

@slandelle
Copy link
Contributor Author

I'll try to get one, but that might be difficult.

If you look at the RFC, max-age is definitively optional: http://tools.ietf.org/html/rfc6265#section-4.1.2.2

Maybe AsyncHttpProviderUtils.parseCookie could:

  • return -1 for cookies that have neither an expire nor a max age, meaning "never expires"
  • return 0 for cookies that have an expire in the past, meaning "expires now"

WDYT?

PS: If you agree with this, I can make a pull request.

jfarcand pushed a commit that referenced this issue Mar 29, 2012
jfarcand added a commit that referenced this issue Mar 29, 2012
@slandelle
Copy link
Contributor Author

thanks!

cs-workco pushed a commit to cs-workco/async-http-client that referenced this issue Apr 13, 2023
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

2 participants