Using tarteaucitron.js in a local webview that does not allow cookie creation #720
andrei-cavoleau
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
Hey, thanks for sharing this : ) This is very specific for your use but, as you already said, it fix the problem for browsers with cookie disabled. I think it can be merged 👍 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone,
For my company's project, I had to make some changes to the library, so I wanted to create a post here if another developer ever has a similar issue.
For our project, we use the library for a web page that is stored in a windows UWP application and displayed with a webview. We noticed that the webview allowed the cookies to the services inside the page such as youtube or google analytics, but creating cookies for storing the user's consent was not possible and the user had to reaccept every time the page was opened.
I guess the creation of cookies is blocked because one of these 2 reasons:
The protocol is not https:// but ms-local-stream://
the hostname format in UWP local webview is
[appAuthor].[appName]_local_[appId]
and not something likewww.google.com
The solution we found, was to modify the lib to detect if creating a cookie for the current domain is possible and if not to store user consent in the localStorage instead of a cookie.
It also has the side effect of storing consent in localStorage for users who have cookies totally disabled so that they don't have to click on the banner for every visit.
So if anyone is in a similar situation, the commit is this one:
andrei-cavoleau@eef43da
We tested this commit on release 1.8.4 and 1.9.1
Hello @AmauriC , am I right that handling this is not part of the scope of the library? I hesitated to make a pull request but my company's issue seems very specific to our project.
Beta Was this translation helpful? Give feedback.
All reactions