Third party cookies

Hey there,

I have an iframe for an external component that our customer uses.

Now, I’ve been tasked with figuring out if visitors to our site have their third-party cookies blocked. The plan is, if they do have them blocked, we want to hide the iframe and pop up a message from the back-office instead.

I’m curious, does Litium have any built-in features that can help me check if a user’s got third-party cookies turned off? I’ve managed to find a way to see if someone’s blocking all cookies, but that’s not quite the same.

Right now, without this check, the iframe just shows up as a big blank space, which isn’t great. We want to be able to tell users, “Hey, you need to enable third-party cookies for this to work.” Any tips or advice on this would be super helpful!

Thanks!

in javascript you can do something like this

<script>

  if(!window.parent) return;

  if('allow_third_party_cookie=yes'.test(document.cookie)) {

    window.parent.postMessage("allow_third_party_cookie", '*');

  }

  else {

    window.parent.postMessage("do_not_allow_third_party_cookie", '*');

  }
</script>

Please check this solution

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.