Sha256: 876359c70a2337d0eebfcb079d7230f044d520d25b173914d0deb940a1d81824

Contents?: true

Size: 1.09 KB

Versions: 17

Compression:

Stored size: 1.09 KB

Contents

# cookie [![Build Status](https://secure.travis-ci.org/defunctzombie/node-cookie.png?branch=master)](http://travis-ci.org/defunctzombie/node-cookie) #

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.

See [RFC6265](http://tools.ietf.org/html/rfc6265) for details about the http header for cookies.

## how?

```
npm install cookie
```

```javascript
var cookie = require('cookie');

var hdr = cookie.serialize('foo', 'bar');
// hdr = 'foo=bar';

var cookies = cookie.parse('foo=bar; cat=meow; dog=ruff');
// cookies = { foo: 'bar', cat: 'meow', dog: 'ruff' };
```

## more

The serialize function takes a third parameter, an object, to set cookie options. See the RFC for valid values.

### path
> cookie path

### expires
> absolute expiration date for the cookie (Date object)

### maxAge
> relative max age of the cookie from when the client receives it (seconds)

### domain
> domain for the cookie

### secure
> true or false

### httpOnly
> true or false

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
hooch-0.4.2 jasmine/node_modules/karma/node_modules/connect/node_modules/cookie/README.md
hooch-0.4.1 jasmine/node_modules/karma/node_modules/connect/node_modules/cookie/README.md
hooch-0.4.0 jasmine/node_modules/karma/node_modules/connect/node_modules/cookie/README.md
hooch-0.3.0 jasmine/node_modules/karma/node_modules/connect/node_modules/cookie/README.md
hooch-0.2.1 jasmine/node_modules/karma/node_modules/connect/node_modules/cookie/README.md
hooch-0.2.0 jasmine/node_modules/karma/node_modules/connect/node_modules/cookie/README.md
hooch-0.1.0 jasmine/node_modules/karma/node_modules/connect/node_modules/cookie/README.md
hooch-0.0.8 jasmine/node_modules/karma/node_modules/connect/node_modules/cookie/README.md
hooch-0.0.7 jasmine/node_modules/karma/node_modules/connect/node_modules/cookie/README.md
hooch-0.0.6 jasmine/node_modules/karma/node_modules/connect/node_modules/cookie/README.md
entangled-0.0.16 spec/dummy/public/node_modules/karma/node_modules/connect/node_modules/cookie/README.md
entangled-0.0.15 spec/dummy/public/node_modules/karma/node_modules/connect/node_modules/cookie/README.md
entangled-0.0.14 spec/dummy/public/node_modules/karma/node_modules/connect/node_modules/cookie/README.md
entangled-0.0.13 spec/dummy/public/node_modules/karma/node_modules/connect/node_modules/cookie/README.md
entangled-0.0.12 spec/dummy/public/node_modules/karma/node_modules/connect/node_modules/cookie/README.md
entangled-0.0.11 spec/dummy/public/node_modules/karma/node_modules/connect/node_modules/cookie/README.md
entangled-0.0.10 spec/dummy/public/node_modules/karma/node_modules/connect/node_modules/cookie/README.md