The clear-site-data
HTTP response header instructs the browser to clear data that is associated with the current site.
Developers can use this header to tell the browser to clear the cache, clear the cookies, or clear everything.
To clear all site data the browser has on the current site, use the wildcard:
Clear-Site-Data: "*"
To tell the browser to clear the cookies, but not the cache or other stored elements:
Clear-Site-Data: "cookies"
"*"
- clears all of the below data types"cookies"
- clears all cookies for the site"cache"
- clears the browser cache, and possibly address bar history related to the site"storage"
- clears the browser storage, such as localStorage
and other storage apis accessible through JavaScriptChrome | 61+ | Since 2017 |
Firefox | 63+ | Since 2018 |
Edge | 79+ | Since 2020 |
Safari | 17+ | Since 2023 |
Use the Clear-Site-Data Playground to see what happens when you set a cookie, then hit another page to clear it.