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

Expiry not set in cookieStorage.js #325

Open
virajsoni06 opened this issue Aug 23, 2021 · 2 comments
Open

Expiry not set in cookieStorage.js #325

virajsoni06 opened this issue Aug 23, 2021 · 2 comments

Comments

@virajsoni06
Copy link

There seems to be an issue with cookieStorage.js which doesn't seem to accept the expiry set for cookies. The expiry is hardcoded ->

doc.cookie = escape(key) + "=" + escape(data) + "; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"

Shouldn't the user be allowed to set it or fallback to default?

@videni
Copy link

videni commented Dec 21, 2021

this library save expires with another cookie, I don't know why this way instead of cookie expires attribute, also another drawback, if you save a string value, it will be serialized by JSON.stringify() , which means double quotes will be part of you value. you need to strip it out if cookie being passed to your server. for example, a token,

token = "abcdef", but you got token = '\"abcdef\"'

@AlirezaEiji191379
Copy link

#328
this is my pr!

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

3 participants