Today I Learned - Rocky Kev

TIL Clear-Site-Data

POSTED ON:

TAGS:

Today I learned about the Clear-Site-Data header.

The Clear-Site-Data header clears browsing data (cookies, storage, cache) associated with the requesting website. It allows web developers to have more control over the data stored by a client browser for their origins.

// Single directive
Clear-Site-Data: "cache"

// Multiple directives (signing out of a website)
Clear-Site-Data: "cache", "cookies", "storage", "executionContexts"

// Wild card
Clear-Site-Data: "*"

Safari isn't fully supported yet. But it will!

Via MDN: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Clear-Site-Data


Related TILs

Tagged:

TIL fancy methods to transform Javascript Objects

You can use Object.entries(), Object.keys(), Object.fromEntries()...

TIL How to steal localData using an XSS attack

But that's just a red flag that opens the door to bigger issues.

TIL Clear-Site-Data

The Clear-Site-Data header clears browsing data (cookies, storage, cache) associated with the requesting website. It allows web developers to have more control over the data stored by a client browser for their origins.