-
Notifications
You must be signed in to change notification settings - Fork 35
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
Deleting a cookie is awkward #12
Comments
I think write operations for multiple cookies aren't quite atomic today,
|
I don't think I explained well in the OP. I'm saying: navigator.cookies.getAll().then(cookies => {
navigator.cookies.delete(cookies[0]);
}) …should work, rather than having to split them out into other arguments. Although this may be another side-effect of this being un-map-like. |
I see. This would require knowing the path+domain for each returned cookie |
Yeah, very much linked to #11 |
Note that Origin-Cookie (if/when that becomes real) makes all those problems disappear. However it's also not backward compatible and may even call for a separate JS API for reads, just as the draft RFC specifies a separate request header today although it shares the same header for setting cookies |
FYI this issue is still present in the more recent API now outlined in the explainer but I think that with sane defaults (mostly path=/ by default and omitted domain by default for write/delete operations, along with recommending __Host- and __Secure- and enforcing their properties in writes through this API) we can make progress toward cleaning up this mess. |
explainer link is bad in the previous comment - needs a |
Fixed, thanks! |
Hah! Apparently the content preview doesn't use base href |
@jakearchibald I've updated the explainer to reflect the current Chrome implementation plus planned additions. I plan to export cookie metadata in such a way that the use case you describe (pass Thank you very much for your feedback here! |
This may depend on #11
When I get cookies via
getAll
, it feels like I should just be able to pass them todelete
rather than having to split the object up into multiple arguments.The text was updated successfully, but these errors were encountered: