0

I am accessing youtube videos on my website and getting an error, that I should specify my SameSite cookies manually but when I do so, it just doesn't work and gives me the same error.

The error message: Indicate whether a cookie is intended to be set in a cross-site context by specifying its SameSite attribute.

My try plain with Javascript:

<script>
    document.cookie = "AC-C=ac-c;expires=Fri, 31 Dec 9999 23:59:59 GMT;path=/;SameSite=Lax";
</script>

My try with js-cookie:

<script type="module" src="/js-cookie/js.cookie.mjs"></script>
<script type="module">
    import Cookies from '/js-cookie/js.cookie.mjs'

    Cookies.set('name', 'value', {
        sameSite: 'none',
        secure: true
    });
</script>
Zagro
  • 27
  • 4
  • What error are you getting? – Barmar Apr 10 '23 at 20:02
  • @Barmar The error message: Indicate whether a cookie is intended to be set in a cross-site context by specifying its SameSite attribute. – Zagro Apr 10 '23 at 20:10
  • That doesn't seem like an error message, it looks like a warning from an IDE or linter. – Barmar Apr 10 '23 at 20:12
  • @Barmar but the console says it's an error and I'm getting the message a few hundred times, which is why I want to set the cookie manually. – Zagro Apr 10 '23 at 20:20

0 Answers0