Skip to content

Cookie.js is a library that manipulates browser cookie. This library uses amd structure.

License

Notifications You must be signed in to change notification settings

elo7/cookie-amd

Repository files navigation

Cookie-amd

Cookie-amd browser cookie library

Cookie.js is a library that manipulates browser cookie. This library uses amd structure.

Build Status

Install

Install with Npm: npm install elo7-cookie-amd

Dependency

Cookie-amd depends on an amd implementation. We suggest define-async implementation for dependency lookup.

Methods

get

.get(name)

Description:

Returns a the cookie value.

Sample:
define(['cookie'], function(cookie) {
	cookie.get('cookie-name');
});

set

.set(name, value, days)

Description:

Creates or rewrite a cookie value with a defined expiration time in days.

Sample:
define(['cookie'], function(cookie) {
	cookie.set('cookie-name', 'value', 1);
});

License

Cookie-amd is released under the BSD. Have at it.


Copyright ©️ 2015 Elo7