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]: Store consent using localStorage or other techniques #606

Closed
boldtrn opened this issue Dec 14, 2023 · 3 comments
Closed

[Feat]: Store consent using localStorage or other techniques #606

boldtrn opened this issue Dec 14, 2023 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@boldtrn
Copy link

boldtrn commented Dec 14, 2023

Description

Right now cookieconsent is using cookies. It would be great if instead of cookies it would be possible to use other methods like localStorage.

Proposed solution

Provide a config option for cookie like storage and provide different options like localstorage.

Additional details

We are working with webviews for mobile apps quite a bit. Especially on iOS webviews tend to drop cookies on close, whereas other technology persits fine. We work with indexeddb and localstorage and both seem to work significantly better than cookies.

@boldtrn boldtrn added enhancement New feature or request triage yet to be reviewed labels Dec 14, 2023
@orestbida orestbida removed the triage yet to be reviewed label Dec 16, 2023
@orestbida
Copy link
Owner

An option like cookie.useLocalStorage should be enough in my opinion:

cookie?: {
    name?: string,
    domain?: string,
    path?: string,
    expiresAfterDays?: number | (acceptType: string) => number,
    sameSite?: string,
    useLocalStorage?: true
}

When using localstorage, options such as domain, path and sameSite will be ignored.

@boldtrn
Copy link
Author

boldtrn commented Dec 16, 2023

Yes indeed, that would be great. Thanks for considering it 👍

@orestbida orestbida added good first issue Good for newcomers and removed 💬 discussion labels Dec 16, 2023
@orestbida orestbida added this to the v3.0.0 milestone Dec 16, 2023
@boldtrn
Copy link
Author

boldtrn commented Dec 19, 2023

Just wanted to say thank you for the quick fix. I can verify that the current v3 branch works fine on webviews as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants