https://github.com/chrisyip/browser-cookie.js
Access browser's cookies easier.
https://github.com/chrisyip/browser-cookie.js
Last synced: about 1 year ago
JSON representation
Access browser's cookies easier.
- Host: GitHub
- URL: https://github.com/chrisyip/browser-cookie.js
- Owner: chrisyip
- License: mit
- Created: 2014-03-18T02:49:56.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-09-16T08:32:24.000Z (almost 12 years ago)
- Last Synced: 2025-05-14T22:12:20.144Z (about 1 year ago)
- Language: JavaScript
- Size: 182 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cookie.js
Access browser's cookies easier.
# How to use
```js
// change default settings
Cookie.setup({
domain: 'mydomain.com', // current domain, default
path: '/path/to/store', // `/`, by default
expires: 3600, // accept string, number and date object
secure: true // `false`, by default
});
Cookie.set('name', 'John Doe', {
expires: '2015-1-1'
});
Cookie.get('name'); // `John Doe`;
Cookie.set('lang', 'JavaScript');
Cookie.keys(); // `['name', 'lang']`
Cookie.has('gender'); // `false`
Cookie.remove('lang');
Cookie.keys(); // `['name']`
Cookie.noConflict();
```
# Gulp task
`build` (alias `default`): compile ES6 script to ES5 with [gulp-traceur](https://github.com/sindresorhus/gulp-traceur).
`watch`: help developing script.
# To-do
- JSHint
- Jasmine
- Testing with connect