WICG / cookie-store

Asynchronous access to cookies from JavaScript
https://wicg.github.io/cookie-store/
Apache License 2.0
144 stars 35 forks source link

Specify the query cookies algorithm. #69

Closed bakulf closed 6 years ago

bakulf commented 6 years ago

It's very hard to evaluate how to implement this API without having this algorithm specified. I can easily guess the meaning of 'name' and 'matchType', but what's the meaning of 'url' when this API is used on window.cookieStore? Is it 'similar' to 'path' or should it be ignored?

inexorabletash commented 6 years ago

Yeah, behavior needs definition. The explainer says "In other words, the only valid url value in Document contexts is the document's URL."

Support isn't added in Blink's implementation yet. I would imagine the behavior would be that if url is given and url does not match the document's url, reject.

inexorabletash commented 6 years ago

Regarding the overall algorithm, I think we need to reference the RFC 6265 Section 5.4, run steps 1-3 which produces a cookie-list, which can then be turned into a CookieList.

We should have an earlier section introduce the concept of a cookie as a structure with fields per RFC 6265 Section 5.3.