Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

david19's avatar

Youtube video without cookies

Hello Team, i tryed to use a iframe youtube video, with the the GDPR modus.

                <iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/zAjTUd5B8UU" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

You can see, there is:

www.youtube-nocookie.com

Now i go to chrome dev tools, and i see a lot of cookies. Yes, it is GPDR ready, but now i need a cookie banner :( I dont like use a cookie banner, only for a video. Laravel save 2 session cookies, which are good. But youtube loads over 10 cookies. I tryed to block this cookies with a middleware, but it will not work. I searched on stakeoverflow, but i dont found answeres. And yes, you need a cookie banner in DE, if youtube load cookies!! :(

0 likes
1 reply
Niush's avatar
Niush
Best Answer
Level 50

What is the cookie domain in dev tools? Is it youtube-nocookie or plain youtube? May be clear all cookies and try again.

1 like

Please or to participate in this conversation.