component-cookie

Tiny cookie component

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
component-cookie
1.1.5a year ago8 years agoMinified + gzip package size for component-cookie in KB

Readme

cookie
Cookie component.

Installation

$ component install component/cookie

Example

// set
cookie('name', 'tobi')
cookie('name', 'tobi', { path: '/' })
cookie('name', 'tobi', { maxage: 60000 }) // in milliseconds
cookie('species', 'ferret')

// get
var name = cookie('name')
// => "tobi"

var cookies = cookie()
// => { name: "tobi", species: "ferret" }

// clear
cookie('name', null)

License

MIT