wackazong Posted April 26, 2019 Share Posted April 26, 2019 On this page: https://www.w3schools.com/js/js_cookies.asp It does not make sense to use decodeURIComponent on document.cookie. It does not contain a valid URI in all cases. Maybe you mean unescape? Link to comment Share on other sites More sharing options...
Ingolme Posted April 27, 2019 Share Posted April 27, 2019 The cookies for a page are stored as a query string in which special characters are encoded, decodeURIComponent is correct. Link to comment Share on other sites More sharing options...
justsomeguy Posted April 29, 2019 Share Posted April 29, 2019 It does not contain a valid URI in all cases. decodeURIComponent decodes a string that was encoded as a component of a URI. It does not require an entire URI. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now