arnaucube
arnaucube/comunicationLeapPublic Self-hosted repository
comunicationLeap/node_modules/cookie/README.md
node_modules/cookie/README.mdRaw
 1# cookie [![Build Status](https://secure.travis-ci.org/shtylman/node-cookie.png?branch=master)](http://travis-ci.org/shtylman/node-cookie) #
 2
 3cookie is a basic cookie parser and serializer. It doesn't make assumptions about how you are going to deal with your cookies. It basically just provides a way to read and write the HTTP cookie headers.
 4
 5See [RFC6265](http://tools.ietf.org/html/rfc6265) for details about the http header for cookies.
 6
 7## how?
 8
 9```
10npm install cookie
11```
12
13```javascript
14var cookie = require('cookie');
15
16var hdr = cookie.serialize('foo', 'bar');
17// hdr = 'foo=bar';
18
19var cookies = cookie.parse('foo=bar; cat=meow; dog=ruff');
20// cookies = { foo: 'bar', cat: 'meow', dog: 'ruff' };
21```
22
23## more
24
25The serialize function takes a third parameter, an object, to set cookie options. See the RFC for valid values.
26
27### path
28> cookie path
29
30### expires
31> absolute expiration date for the cookie (Date object)
32
33### maxAge
34> relative max age of the cookie from when the client receives it (seconds)
35
36### domain
37> domain for the cookie
38
39### secure
40> true or false
41
42### httpOnly
43> true or false
44