microcipcip / cookie-universal

Universal cookie plugin, perfect for SSR
524 stars 39 forks source link

removeAll documentation #114

Closed Tobeyforce closed 2 years ago

Tobeyforce commented 3 years ago

I think it would be greatly appreciated if you could document a little bit more on how removeAll() works with some examples, my current interpretation is that you can just give it an array of strings, but could you do more? E.g hand it an array of objects, e.g with path etc. My use case is that I want to be able to remove all cookies from one particular path/domain in one function call. E.g, the user opts out of facebook pixel -> opt out of facebook pixel and remove all the cookies for it.

Tobeyforce commented 3 years ago

Actually I realize that removeAll() does exactly that, removes every single cookie. Is there any way to remove multiple cookies in one call, without running a forloop with remove()?

microcipcip commented 3 years ago

@Tobeyforce, so what you would like to do is something like this, right?

cookies.removeAll({ path: '/specific/path' })
Tobeyforce commented 3 years ago

@Tobeyforce, so what you would like to do is something like this, right?

cookies.removeAll({ path: '/specific/path' })

Exactly, that would be excellent. Sorry for the late reply!

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.