Fix license issues
[sdnc/oam.git] / dgbuilder / dgeflows / node_modules / express / node_modules / cookie / README.md
1 # cookie [![Build Status](https://secure.travis-ci.org/defunctzombie/node-cookie.png?branch=master)](http://travis-ci.org/defunctzombie/node-cookie) #
2
3 cookie 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
5 See [RFC6265](http://tools.ietf.org/html/rfc6265) for details about the http header for cookies.
6
7 ## how?
8
9 ```
10 npm install cookie
11 ```
12
13 ```javascript
14 var cookie = require('cookie');
15
16 var hdr = cookie.serialize('foo', 'bar');
17 // hdr = 'foo=bar';
18
19 var cookies = cookie.parse('foo=bar; cat=meow; dog=ruff');
20 // cookies = { foo: 'bar', cat: 'meow', dog: 'ruff' };
21 ```
22
23 ## more
24
25 The 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