DevKits

Security · Response header

Clear-Site-Data

Instructs the browser to clear cookies, storage, and caches for the site.

What is Clear-Site-Data?

Clear-Site-Data lets a response tell the browser to wipe stored data for the origin — cookies, localStorage/sessionStorage, IndexedDB, and HTTP caches. It's most useful on logout, so leftover session state can't be reused on a shared machine.

Typical usage

Set on a logout response to clean up client-side state. Use the wildcard `*` to clear everything, or list specific data types.

Examples

Clear everything on logout

Clear-Site-Data: "*"

Clear only cookies and storage

Clear-Site-Data: "cookies", "storage"

Common gotchas

Clearing `cache` can be heavy-handed — it may evict assets shared with other pages on the same origin. On logout, clearing `cookies` and `storage` is usually enough.

Also known as

Also commonly written as: clear-site-data header · clear site data · clear cookies on logout header · clear-site-data logout. These variants — including plural forms, unhyphenated spellings, and Japanese (ヘッダ) — all refer to the same Clear-Site-Data HTTP header.

Specification

W3C Clear Site Data

Frequently asked questions

What is the Clear-Site-Data HTTP header?

Clear-Site-Data lets a response tell the browser to wipe stored data for the origin — cookies, localStorage/sessionStorage, IndexedDB, and HTTP caches. It's most useful on logout, so leftover session state can't be reused on a shared machine.

Is Clear-Site-Data a request or response header?

Clear-Site-Data is a response header — the server sends it to the client. Set on a logout response to clean up client-side state. Use the wildcard `*` to clear everything, or list specific data types.

What does a Clear-Site-Data header look like?

A typical Clear-Site-Data header looks like: Clear-Site-Data: "*" (Clear everything on logout).

What are common mistakes with Clear-Site-Data?

Clearing `cache` can be heavy-handed — it may evict assets shared with other pages on the same origin. On logout, clearing `cookies` and `storage` is usually enough.

Related headers

Work with this header