Clear-Site-Data Playground: Set Data

This page sets a cookie, a localStorage item, and a sessionStorage item:

<script>
    //set a cookie
    document.cookie = "username=pete";

    //set localStorage item
    localStorage.setItem('username', 'pete');

    //set sessionStorage item
    sessionStorage.setItem('username', 'pete');

</script>

Next open up your browser developer tools to see the data, then click on the button to clear the site data via the Clear-Site-Data header

Clear All Site Data