1.4.0 • Published 7 years ago

my-simple-cookie v1.4.0

Weekly downloads
13
License
MIT
Repository
github
Last release
7 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

7 years ago

1.3.9

7 years ago

1.3.8

7 years ago

1.3.7

7 years ago

1.3.6

7 years ago

1.3.5

8 years ago

1.3.4

8 years ago

1.3.2

8 years ago

1.3.1

8 years ago

1.3.0

8 years ago

1.2.0

8 years ago

1.1.9

8 years ago

1.1.8

8 years ago

1.1.7

8 years ago

1.1.6

8 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago