HTTP headers | Clear-Site-Data

The HTTP header Clear-Site-Header is a response-type header. This header is used in deleting the browsing data which is in the requesting website. These browsing data includes cache, cookies, storage and executionContents. It helps the web developers to have an improved level of control over data stored by the browser locally.

Syntax:

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

Note: The data to be deleted, directibves should be given within double quotes (” “). Multiple directives can be given at a time.



Directives: This header accepts four directives mentioned above and described below:

  • “cache”: It represents that the server wishes to remove locally cached data.
  • “cookies”: It represents the server wishes to delete all the cookies for the origin of response URL.
  • “storage:” It represents the server wishes to remove locally stored data.
  • “executionContents”: It represents the server wishes to remove all the browsing contents for the origin of response URL.
  • ” * “: It represents the server wishes to delete all types of data for the origin of response URL.

Examples:

  • In this example header wants to delete the cache, cookies, storage and executionContents data.
    Clear-Site-Data: "cache", "cookies", "storage", "executionContents"
  • In this example header wants to delete all the data.
    Clear-Site-Data: " * "

Based on the directives mentioned, the corresponding type of data will be removed. To check the Clear-Site-Data go to the Inspect Element->Network click any visible name after that click the header tab if this header is used then it will be visible to you.

Supported Browsers: The browsers compatible with HTTP Clear-Site-Data headers are given below.

  • Google Chrome
  • Firefox
  • Opera



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.