-
Notifications
You must be signed in to change notification settings - Fork 26
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
Encoding Cookie Value #13
Comments
Hi, Orejime.init({
stringifyCookie(consents) {
return encodeURIComponent(JSON.stringify(consents));
},
parseCookie(cookie) {
return JSON.parse(decodeURIComponent(cookie));
}
}); Of course those options would default to the current behavior if not specified. |
The generic version is interesting, we could imagine someone wanting to crypt the data. It ok to me. |
Here's a PR, do you want to try it out before merging ? |
It's ok to me you can merge it. |
Hi @jobartim44, I just released version 1.2.0 with this feature, I hope it gets the job done! |
Hi,
I need to access the cookie value on the server-side with a Java Application (Apache Tomcat). For that the JSON String need to be encoded otherwise I have an exception.
It's simply a encodeURIComponent(JSON.stringify(this.consents)) and JSON.parse(decodeURIComponent(e.value)).
Can you imagine it as an option in the configuration ?
Thanks
The text was updated successfully, but these errors were encountered: