Clear-Site-Data Header (Clear-Site-Data)
Why Clear-Site-Data Matters
When a user logs out of your application, you should clear all client-side state to prevent the next user on a shared device from accessing the previous user's session. Server-side session invalidation alone is not sufficient because cached pages, stored tokens, and service worker caches may still contain sensitive data.
Clear-Site-Data: "cookies", "storage", "cache" on your logout response thoroughly cleans up all client-side state. This is especially important for applications handling sensitive data (banking, healthcare, corporate) where session leakage between users on shared devices is a real risk.
The header is also useful during security incident response. If you detect that a user's session has been compromised, sending Clear-Site-Data on the next response clears any attacker-planted data (service workers, cached content) from the legitimate user's browser.
How to Verify
A security audit may check for Clear-Site-Data usage. Verify it is sent on your logout endpoint. The recommended value is "cookies", "storage", "cache" to clear all client-side data types.