clearsitedata
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

Clear Site Data

Build Status

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']
}))

Package Sidebar

Install

npm i clearsitedata

Weekly Downloads

66

Version

0.2.0

License

MIT

Unpacked Size

5.31 kB

Total Files

6

Last publish

Collaborators

  • evanhahn