clearsitedata
v0.2.0
Published
Middleware to set the Clear-Site-Data HTTP header
Downloads
59
Maintainers
Readme
Clear Site Data
The Clear-Site-Data HTTP header allows you to instruct browsers to clear all of their local data (caches, cookies, etc). This is useful in a number of cases, like when a user logs out.
Usage:
const clearSiteData = require('clearsitedata')
// Clear everything
app.post('/logout', clearSiteData({
directives: ['*']
}))
// Clearing everything is the default
app.post('/logout', clearSiteData())
// Only clear cookies and storage
app.post('/logout', clearSiteData({
directives: ['cookies', 'storage']
}))