Skip to content
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

[Feat]: callable method of removing cookies, like a performAutoclearCookies function #712

Open
timkrins opened this issue Jul 26, 2024 · 3 comments
Labels
enhancement New feature or request triage yet to be reviewed

Comments

@timkrins
Copy link

timkrins commented Jul 26, 2024

Description

I want to run a callback that will remove cookies after every navigation etc, to ensure any rogue cookies set even after initial consent change are deleted.

In my own fork I was exposing the functionality of the old autoclearCookies function, and calling this. This function is now autoclearCookiesHelper, but is not exported.

Would there be a current alternative, or would you be open to a PR that adds this somehow?

Proposed solution

Export the autoclearCookiesHelper function, or export a helpers object such as helpers: { autoclearCookiesHelper } for advanced usage.

Or

Export a performAutoclearCookies function that calls autoclearCookiesHelper(true).

Additional details

No response

@timkrins timkrins added enhancement New feature or request triage yet to be reviewed labels Jul 26, 2024
@timkrins timkrins changed the title [Feat]: callable method of removing cookies, like aclearDisabledCategoryCookies function [Feat]: callable method of removing cookies, like a clearDisabledCategoryCookies function Jul 26, 2024
@timkrins
Copy link
Author

timkrins commented Jul 26, 2024

Hmm... maybe I could use a workaround such as calling CookieConsent.validConsent() && CookieConsent.acceptCategory(CookieConsent.getUserPreferences().acceptedCategories) in my callback...

@timkrins
Copy link
Author

Nope, that workaround doesn't work, as isFirstConsent, categoriesWereChanged and servicesWereChanged are all false.

@timkrins
Copy link
Author

My example PR is here: #713

@timkrins timkrins changed the title [Feat]: callable method of removing cookies, like a clearDisabledCategoryCookies function [Feat]: callable method of removing cookies, like a performAutoclearCookies function Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage yet to be reviewed
Projects
None yet
Development

No branches or pull requests

1 participant