Skip to content

Latest commit

 

History

History
54 lines (28 loc) · 1.19 KB

README.md

File metadata and controls

54 lines (28 loc) · 1.19 KB

Cookies Module

Utility functions for reading and setting cookies in the browser and from server-side CouchDB functions (lists, shows, updates etc).

API

readBrowserCookies()

Read cookies currently stored in the browser, returning an object keyed by cookie name.

readBrowserCookie(name)

Reads browser cookies and returned the value of the named cookie.

Parameters

  • name String - the name of the cookie to read

cookieString(req, opt)

Creates a string for storing a cookie on the browser.

Parameters

  • req Object - the CouchDB request object
  • opt Object - properties for the cookie (name, value, path, days)

setBrowserCookie(req, opt)

Sets a cookie on the browser, for use client-side only.

Parameters

  • req Object - the CouchDB request object
  • opt Object - properties for the cookie (name, value, path, days)

setResponseCookie(req, res, opt)

Creates a Set-Cookie header on a CouchDB response object. Returning the response object with the updated Set-Cookie headers.

Parameters

  • req Object - the CouchDB request object
  • res Object - the CouchDB response object
  • opt Object - properties for the cookie (name, value, path, days)