Closed lcrespilho closed 7 years ago
@lcrespilho
Thanx for opening this issue!
This library aims to abstract JavaScript's access to cookies, but does not aim to help good standards to become deprecated. The max-age
parameter is a good parameter and is a standard defined in rfc6265. Nevertheless the lack of support in some browsers, as your comment attests, cannot be ignored.
After thinking a bit, I decided, instead of removing the library's internal usage of max-age
, to explain the current situation and offer an easy solution in a note in the MDN article – which is the official documentation page of this library.
All the best!
@madmurphy Thanks for your feedback. I just saw the note on MDN article and your argument sounds fair.
Thanks a lot. Regards.
On setItem method, the use of max-age isn't compatible with any version of Internet Explorer, Edge and a lot of Mobile browsers (as sugested by MDN Document.cookie).
Maybe you could alter line 37 with something like this:
sExpires = vEnd === Infinity ? "; expires=Fri, 31 Dec 9999 23:59:59 GMT" : "; expires=" + new Date(new Date().getTime() + vEnd).toUTCString();
that has full browser support.Thanks a lot. Best regards.