-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Cookie needs an update to support HttpOnly (and also Secure) #517
Comments
Is there an RFC or other specification that notes this behavior? |
found RFC Here: |
Looks like "User Agents" should ignore unknown attributes:
So it looks like instead of throwing an error, we just set the "true" flag as suggested by the OP and move on, then the caller of our Cookie class is responsible for validating actual attributes. |
Also:
|
@johnjaylward I've tested your changes and they work for my simple use case just fine. But I also looked a little bit at the details and it seems that you've forgotten to escape the Maybe you could also add a little check for the boolean value of an additional attribute in the JSONObject. Someone could have added something like HttpOnly=false to the JSONObject. Parsing this to a cookie string would lead to the addition of ";HttpOnly"! |
Hi,
I was happy to see your little Cookie-Implementation but it does not handle tokens without an '=' correctly!
There is only one exception for the "secure" token in the code, even "Secure" or other case-insensitive versions won't work. The standard request field "HttpOnly" will throw an exception like everything else too.
The best solution would be to handle all tokens without an '=' as a Boolean.TRUE.
The text was updated successfully, but these errors were encountered: