Cookies

Cookies API mozilla

The cookie module provides utilities for working with cookies.

To use this module:

const cookies = require('cookies');

cookie.getAll(details)

  • details <object> An object containing details that can be used to match cookies to be retrieved
    • name <string> A string representing a name that the cookies should have.
    • path <string> A string representing a path — the cookies' path must be identical to this one.
  • Returns: <object> array of cookie objects

Retrieves all cookies from a cookie store that match the given information.

cookie.set(cookie)

  • cookie <object> An object containing details that can be used to match cookies to be retrieved

Set cookie

cookie.remove(name)

Deletes a cookie by name.