DevToolsmith

Clear-Site-Data Header

The Clear-Site-Data response header asks the browser to delete cookies, storage and cache for the site, for example on logout.

Type
Response header
Category
Requests, redirects and more
Defined in
Clear Site Data (W3C)

Syntax

Clear-Site-Data: "cache", "cookies", "storage", "executionContexts"  |  "*"

How Clear-Site-Data works

One response can wipe everything the browser keeps for your origin: cookies, localStorage and IndexedDB, the HTTP cache and service workers. It is the reliable way to make logout complete, or to recover users stuck with a broken service worker. The values must be quoted.

Examples

On logout
Clear-Site-Data: "cookies", "storage"
Reset everything
Clear-Site-Data: "*"

Check it

curl -sI https://example.com | grep -i '^clear-site-data:'

Paste a full set of response headers into the HTTP header checker to get every header explained and common mistakes flagged.

Related headers

  • Set-Cookie: stores a cookie in the browser, with attributes that control its lifetime, scope and security.
  • Cache-Control: tells browsers, CDNs and proxies whether a response may be stored, by whom, and for how long.
  • Cookie: sends the browser’s stored cookies for this site back to the server.

More requests, redirects and more headers

Location , Retry-After , User-Agent , Host , Link , Sec-Fetch-Site , Server-Timing .

Sources

Spotted a mistake? Email hello@devtoolsmith.com and we’ll fix it.

Frequently asked questions

What does the Clear-Site-Data header do?

The Clear-Site-Data response header asks the browser to delete cookies, storage and cache for the site, for example on logout. One response can wipe everything the browser keeps for your origin: cookies, localStorage and IndexedDB, the HTTP cache and service workers. It is the reliable way to make logout complete, or to recover users stuck with a broken service worker. The values must be quoted.

How do I see the Clear-Site-Data header?

Run "curl -sI https://example.com" to print a response’s headers, or open the Network tab in your browser’s dev tools and select the request. Paste the headers into the HTTP header checker on this site to get each one explained.