-
Notifications
You must be signed in to change notification settings - Fork 32
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
Wrong cookie handling #59
Comments
Hello @Domain, Thanks for report, will look a bit later. |
Hello @Domain set-cookie processed in https://github.com/ikod/dlang-requests/blob/master/source/requests/http.d#L631 and as far as I can see it breaks https://tools.ietf.org/html/rfc6265#section-5.2.3 in that it do not strip leading dot away.
Then, when we build headers for next request https://github.com/ikod/dlang-requests/blob/master/source/requests/http.d#L493 I just follows rules from RFC. Can you, please, give me example of wrong request processing, so that I can find where exactly problem is. Thanks |
@ikod 5.1.3. Domain Matching A string domain-matches a given domain string if at least one of the following conditions hold: o The domain string and the string are identical. (Note that both the domain string and the string will have been canonicalized to lower case at this point.) o All of the following conditions hold: * The domain string is a suffix of the string. * The last character of the string that is not included in the domain string is a %x2E (".") character. * The string is a host name (i.e., not an IP address). So "x.example.com" matches "example.com" See also: https://www.mxsasha.eu/blog/2014/03/04/definitive-guide-to-cookie-domains/ |
A cookie will be overwritten (or deleted) by a subsequent cookie exactly matching the name, path and domain of the original cookie. 11. If the cookie store contains a cookie with the same name, domain, and path as the newly created cookie: 1. Let old-cookie be the existing cookie with the same name, domain, and path as the newly created cookie. (Notice that this algorithm maintains the invariant that there is at most one such cookie.) 2. If the newly created cookie was received from a "non-HTTP" API and the old-cookie's http-only-flag is set, abort these steps and ignore the newly created cookie entirely. 3. Update the creation-time of the newly created cookie to match the creation-time of the old-cookie. 4. Remove the old-cookie from the cookie store. 12. Insert the newly created cookie into the cookie store. Now the new cookie is just appended to the end. |
@Domain |
If the domain value of a cookie does not start with a . it will be added by the client.
A cookie will be overwritten (or deleted) by a subsequent cookie exactly matching the name, path and domain of the original cookie.
How do browser cookie domains work?
How to handle multiple cookies with the same name?
The text was updated successfully, but these errors were encountered: