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

Use localStorage instead of Cookies to store pause time (optional) #536

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

Palabola
Copy link
Contributor

@Palabola Palabola commented Sep 1, 2021

During our security review it turned out that the stored cookie doesn't have the HttpOnly attribute, this is not a surprise since this cannot be set from JS by design.
We came to the same conclusion as @stebunovd in #475, that the usage of localStorage instead of document.cookies would be a solution.

The proposed changes introduce a new option use_local_storage (default: false). If true, localStorage will be used instead of cookies.

The code will store the cookie expiry time under browserupdateorg key and will check the existence/expiry of the value when setting op.already_shown.
The key will also be deleted if expired, or pauseFor() (renamed from setCookie()) called with <=0.

Also happy to open a new PR with cleaned up commit messages if that's a concern, although probably not an issue with a squash merge if otherwise looks good.

…date into browser-update-master

# Conflicts:
#	scripts/update.show.min.js
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

Successfully merging this pull request may close these issues.

None yet

1 participant