Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.

Latest commit

 

History

History
59 lines (40 loc) · 1.7 KB

README.md

File metadata and controls

59 lines (40 loc) · 1.7 KB

township-cookie

helpers for using cookies with township

npm travis standard conduct

About

If your use case requires you to store the JWTs that township creates in cookies rather than localstorage or similar, this module can help.

Install

npm install --save township-cookie

Usage

var townshipCookie = require('township-cookie')

var cookies = townshipCookie({
  name: 'example',
  hostname: 'example.com'
})

// set a cookie with a JWT token on a response object
cookies.set(res, token)

// get a token from a cookie on a request object
var token = cookies.get(req)

// remove a cookie from a response object
cookies.remove(req)

Contributing

Contributions are welcome! Please read the contributing guidelines first.

Conduct

It's important that this project contributes to a friendly, safe, and welcoming environment for all, particularly for folks that are historically underrepresented in technology. Read this project's code of conduct

License

ISC