Functionality cookie · YouTube

YSC Cookie: What It Is, Who Sets It, and Consent Rules

Last verified 2026-10-17 · Updated 2026-10-17

On this page
  1. What the YSC cookie does
  2. Who sets the YSC cookie
  3. Does the YSC cookie need consent?
  4. How to block the YSC cookie
  5. How long the YSC cookie lasts
  6. Cookies that work with YSC
  7. Scripts and requests of YouTube
  8. YSC cookie FAQs

What the YSC Cookie Does on Your Site

The YSC cookie is a third-party functionality cookie that the YouTube embed player sets on .youtube.com to confirm that the requests of a browsing session come from the viewer. The YSC cookie is a security cookie that helps "ensure that requests within a browsing session are made by the user", according to the Google page on how Google uses cookies. The YouTube embed player writes the YSC cookie with the first response of the player, before the visitor presses play. Your cookie scanner therefore reports the YSC cookie on every page with a YouTube video, under .youtube.com and not under your own domain.

The YSC cookie arrives together with the VISITOR_INFO1_LIVE cookie and 3 more YouTube cookies. The YSC cookie lasts for the browsing session, and the other YouTube cookies stay for 6 months (180 days).

YSC cookie facts
Cookie nameYSC
VendorYouTube
CompanyGoogle LLC (Google Ireland Limited for visitors in the EU)
CategoryFunctionality
PartyThird-party
Domain.youtube.com
Set byThe YouTube embed player at www.youtube.com/embed/, in a Set-Cookie HTTP response header
RetentionSession (no expiry date, so the browser deletes the cookie when the session ends)
HttpOnlyYes
SecureYes
SameSiteNone, with the Partitioned attribute
Cookie Consent categoryfunctionality
Privacy Consent vendor categoryFunctionality (functionality)

Who Sets the YSC Cookie

The YouTube embed player sets the YSC cookie. The cookie arrives in the HTTP response of the embed URL www.youtube.com/embed/<video-id>, according to a TermsFeed check of the response headers on 17 October 2026. The same response sets the VISITOR_INFO1_LIVE, VISITOR_PRIVACY_METADATA, __Secure-YNID, and __Secure-ROLLOUT_TOKEN cookies. All 5 cookies arrived with SameSite=None, Secure, and Partitioned in that check. A cookie inside a frame on another site needs SameSite=None together with Secure. Partitioned is an optional attribute that keeps a separate copy of the cookie for each site that embeds the frame. Plugins and page builders that embed YouTube videos use the same embed URL.

YouTube sends the YSC cookie with the Partitioned attribute, so Chrome keeps a separate YSC cookie for each site that embeds YouTube. The YSC cookie on your pages therefore never matches the YSC cookie of the same visitor on youtube.com.

Read how Google LLC handles the data in the YouTube privacy policy. Both documents appear in the sources at the end of this page.

How to Block the YSC Cookie Until Visitors Accept

Block the YSC cookie by holding back the script that inserts the YouTube player until the visitor accepts functionality cookies. TermsFeed Free Cookie Consent and TermsFeed Privacy Consent place YouTube in the functionality category. Check whether an exemption applies to your own use of YouTube in the consent rules for the YSC cookie.

The YouTube player writes no YSC cookie while the script that inserts the player waits as a tagged script. Leave an empty <div> with a short text in place of the video, so visitors who decline see why the video is missing.

Block the YSC Cookie With TermsFeed Free Cookie Consent

TermsFeed Free Cookie Consent runs a tagged script only after the visitor accepts its category. Change type="text/javascript" to type="text/plain" and add data-cookie-consent="functionality", the Cookie Consent category for functionality cookies. The tagged the script that inserts the YouTube player looks like this.

<div id="youtube-1"></div>
<script type="text/plain" data-cookie-consent="functionality">
  document.getElementById('youtube-1').innerHTML =
    '<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/VIDEO_ID" ' +
    'title="YouTube video player" allowfullscreen></iframe>';
</script>

Cookie Consent runs the tagged code after the visitor clicks "I agree" or accepts the functionality category in the Preferences Center. The illustration shows the consent banner and the script it releases.

The TermsFeed Free Cookie Consent banner: (1) the visitor clicks "I agree", (2) Cookie Consent runs the script tagged functionality. Illustration of the consent banner.

Cookie Consent is free and needs no account. Build your free consent banner with TermsFeed Free Cookie Consent.

Block the YSC Cookie With TermsFeed Privacy Consent

Add YouTube from its template in TermsFeed Privacy Consent, and each video shows a consent placeholder until the visitor accepts YouTube. Replace each YouTube <iframe> with the replaceable tag of the template, which loads the video from www.youtube-nocookie.com once the visitor accepts.

The placeholder turns into the YouTube player without a page reload. Give each video on a page its own ID, such as youtube-1 and youtube-2, so Privacy Consent swaps every video of the page.

The YouTube template asks for no ID and fills every field of the vendor. Pick the "YouTube" card under Functionality and click "Add YouTube". The illustration shows the template form in the TermsFeed app.

The YouTube template in TermsFeed Privacy Consent: (1) pick the card, (2) click "Add YouTube". Illustration of the TermsFeed app.

Privacy Consent detects the location of each visitor and records every answer in a consent log. Set up YouTube from its template with TermsFeed Privacy Consent.

How to Verify That the YSC Cookie Waits for Consent

Verify the setup in a private window. Open Chrome DevTools, select the Application tab, and open Cookies. Click "I decline" on the consent banner and reload the page. The YSC cookie must not appear in the list until you accept functionality cookies.

How Long the YSC Cookie Lasts

The YSC cookie lasts for the browser session, because the YSC cookie has no expiry date. A browser that restores the last session at start-up keeps the YSC cookie after a restart.

The YSC cookie "lasts for the duration of a user's browsing session", according to the Google page on how Google uses cookies. The response header of the embed player sets no expiry date, so the browser deletes the YSC cookie when the visitor closes the browser.

Scripts and Requests of YouTube That Come With the YSC Cookie

The catalog lists 2 scripts, pixels, and data endpoints of YouTube, which a cookie scanner or the Network tab of Chrome DevTools shows next to the YSC cookie. Block the main script, and the requests in the table stop with the main script.

TypeResourceHostWhat it does
IframeYouTube embed (youtube.com)youtube.com
www.youtube.com
The YouTube embed player loads the video from www.youtube.com/embed/ and writes the YSC and VISITOR_INFO1_LIVE cookies with its first response.
IframeYouTube (Privacy Mode) embed (youtube-nocookie.com)youtube-nocookie.com
www.youtube-nocookie.com
The privacy-enhanced YouTube player loads the video from www.youtube-nocookie.com/embed/, and its first response sets no cookie.

YSC Cookie FAQs

Is YSC a necessary cookie?

No, the YSC cookie is not a strictly necessary cookie for your site. Firstly, your pages work the same for a visitor who refuses the YouTube player, apart from the video itself. Secondly, the YSC cookie protects the sessions of YouTube, a service of Google that your site embeds. Thirdly, the strictly necessary exception covers only storage essential to a service the visitor asks for, and the YouTube player sets the YSC cookie before the visitor presses play.

Does youtube-nocookie.com stop the YSC cookie?

Yes, the embed page of www.youtube-nocookie.com set no YSC cookie in a TermsFeed check on 17 October 2026, while the same video on www.youtube.com set 5 cookies. Firstly, the privacy-enhanced player answers from a separate domain of Google. Secondly, Google describes the privacy-enhanced mode as a mode that keeps the views of embedded videos from influencing the YouTube experience of the viewer. Thirdly, Google gives no list of the cookies and local storage keys that the privacy-enhanced player writes after the visitor presses play. Keep the privacy-enhanced player behind consent as well.

What is the difference between YSC and VISITOR_INFO1_LIVE?

The YSC cookie guards a single browsing session and has no expiry date, and the VISITOR_INFO1_LIVE cookie personalises YouTube recommendations for 6 months. Google lists the YSC cookie as a security cookie and the VISITOR_INFO1_LIVE cookie as a personalisation cookie that __Secure-YNID replaces.

Why does the YSC cookie appear before the visitor plays the video?

The YouTube embed player sets the YSC cookie in the first HTTP response of the player, so the cookie appears as soon as the page loads the video frame. The visitor never needs to press play. Hold back the player until the visitor accepts to keep the YSC cookie away from visitors who decline.

Sources for the YSC Cookie

The facts on this page come from the documentation Google publishes, checked on 2026-10-17. The catalog lists every source so you check each fact yourself.