1.4.0 • Published 9 years ago

my-simple-cookie v1.4.0

Weekly downloads
13
License
MIT
Repository
github
Last release
9 years ago

My Simple Cookie

Simple cookie handling module

Setting a cookie:

cookies.set(cookieName, cookieValue, opts);

var cookies = require('my-simple-cookie');
cookies.set('newCookie', 'cookieValue', { expires: 60*60*24, path: '/' } );

Will create a new cookie named newCookie with the value newCookie with 1 day expiration and / as path cookie value should only be a string

Updating a cookie:

cookies.update(cookieName, cookieValue, opts);

cookies.set('newCookie', 'cookieValue', { expires: 60*60*24, path: '/' } );

// Or

cookies.update('newCookie', 'cookieValue', { expires: 60*60*24, path: '/' } );

Retrieving a cookie:

cookies.get(cookieName);

cookies.get('newCookie' );

Will return the value of "newCookie"

Removing a cookie

cookies.remove(cookieName);

cookies.remove('newCookie' );

Will delete the cookie "newCookie"

Options:

expires : (Number) Number of second till cookie expires in seconds {default to : closing browser}. path : (String) Path of the cookie {default to : / }. domain : (String) domain of the cookie {default to : current domain }. httponly : (Boolean) should we flag the cookie as httpOnly ? {default to : false }. secure : (Boolean) should we flag the cookie as secured ? {default to : false }.

1.4.0

9 years ago

1.3.9

9 years ago

1.3.8

9 years ago

1.3.7

9 years ago

1.3.6

9 years ago

1.3.5

9 years ago

1.3.4

9 years ago

1.3.2

9 years ago

1.3.1

9 years ago

1.3.0

9 years ago

1.2.0

9 years ago

1.1.9

10 years ago

1.1.8

10 years ago

1.1.7

10 years ago

1.1.6

10 years ago

1.1.5

10 years ago

1.1.4

10 years ago

1.1.3

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.0

10 years ago