Last active
February 21, 2024 11:36
-
-
Save jrivero/949141 to your computer and use it in GitHub Desktop.
Pure Javascript Cookies Management
i used your script before and it was fine but now it seems to be setting individual cookies per page. tested in firefox and chrome. I was setting a cookie on page2 but page3 wouldnt see it.
I changed this line 26:
document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : "; expires=" + exdate.toUTCString()) + "; path=/";
and its now a global sitewide cookie.
You have to use some ES6 syntaxis, visit my gist version
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Replace 32 line to