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

addToLocalStorage should not fallback to cookies on exception #361

Open
eltoder opened this issue Feb 23, 2018 · 0 comments
Open

addToLocalStorage should not fallback to cookies on exception #361

eltoder opened this issue Feb 23, 2018 · 0 comments

Comments

@eltoder
Copy link

eltoder commented Feb 23, 2018

Currently addToLocalStorage() catches exceptions from webStorage.setItem() and falls back to writing to cookies if an exception happened (code). This seems wrong:

  • It doesn't check self.defaultToCookie before doing so.
  • Since browserSupportsLocalStorage is true, there's no matching code in getFromLocalStorage() to read the saved value.

In practice this leads to the following problem: if the local storage limit is exceeded, the data starts being written to cookies, which quickly overflows the cookie size limits and causes 400.

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

No branches or pull requests

1 participant