Cookie-amd browser cookie library
Cookie.js is a library that manipulates browser cookie. This library uses amd structure.
Install with Npm: npm install elo7-cookie-amd
Cookie-amd depends on an amd implementation. We suggest define-async implementation for dependency lookup.
.get(name)
Returns a the cookie value.
define(['cookie'], function(cookie) {
cookie.get('cookie-name');
});
.set(name, value, days)
Creates or rewrite a cookie value with a defined expiration time in days.
define(['cookie'], function(cookie) {
cookie.set('cookie-name', 'value', 1);
});
Cookie-amd is released under the BSD. Have at it.
Copyright ©️ 2015 Elo7