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

[Suggestion] Cookie Options such as expiry for Cookie Stores #52

Closed
Lowisz opened this issue Jul 25, 2023 · 2 comments · Fixed by #54
Closed

[Suggestion] Cookie Options such as expiry for Cookie Stores #52

Lowisz opened this issue Jul 25, 2023 · 2 comments · Fixed by #54
Labels
enhancement New feature or request

Comments

@Lowisz
Copy link

Lowisz commented Jul 25, 2023

It would be great if there were a way to set/change some cookie options on cookie stores, such as expiry.

Use Case: An API issues a JWT token that expires after x time, and after expiring, the svelte app doesn't know that the token has expired while it continues trying to use that token. This behavior leads to errors when fetching data using the now expired token.

If it were possible to set expiry dates to cookies, then it would've been possible to know that the token isn't valid anymore because the cookie would return undefined.

While this could easily be done by creating the cookies manually, it would be great to have the option to do it using this package.

Thanks.

@MacFJA MacFJA added the enhancement New feature or request label Jul 25, 2023
@MacFJA MacFJA linked a pull request Aug 7, 2023 that will close this issue
@MacFJA
Copy link
Owner

MacFJA commented Aug 13, 2023

I released the version 2.4.0 which integrate an additional parameter in the createCookieStorage to add cookie options

@Catsvilles
Copy link

What about an expiration option for createIndexedDBStorage?

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

Successfully merging a pull request may close this issue.

3 participants