store.js icon indicating copy to clipboard operation
store.js copied to clipboard

Expiry not set in cookieStorage.js

Open virajsoni06 opened this issue 4 years ago • 2 comments

There seems to be an issue with cookieStorage.js which doesn't seem to accept the expiry set for cookies. The expiry is hardcoded -> https://github.com/marcuswestin/store.js/blob/b8e22fea8738fc19da4d9e7dbf1cda6e5185c481/storages/cookieStorage.js#L43

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

virajsoni06 avatar Aug 23 '21 08:08 virajsoni06

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\"'

videni avatar Dec 21 '21 06:12 videni

#328 this is my pr!

AlirezaEiji191379 avatar Dec 24 '21 13:12 AlirezaEiji191379