Skip to content

kanso/cookies

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

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)

About

Kanso package for the cookies module

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published