Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tristen/wookie
Basic HTTP cookie handling.
https://github.com/tristen/wookie
Last synced: 19 days ago
JSON representation
Basic HTTP cookie handling.
- Host: GitHub
- URL: https://github.com/tristen/wookie
- Owner: tristen
- Created: 2014-05-25T04:31:35.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-06-06T23:13:26.000Z (over 10 years ago)
- Last Synced: 2024-04-24T15:45:50.975Z (8 months ago)
- Language: JavaScript
- Size: 156 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## wookie
Basic HTTP cookie handling for node or browsers.
![](http://cl.ly/VhaO/cookie.png)
### Usage
```js
var cookie = require('wookie');cookie.set('name', 'foo').get('name'); // 'foo'
```### API
#### wookie.set(name, value, expires, path, domain)
Sets a cookie to `document.cookie`.
#### wookie.get(name)
Returns the name of a set cookie.
#### wookie.setObject(object, expires, path, domain)
Set multiple cookies using an object, property name corresponds to the
cookie name.#### wookie.getObject()
Returns all cookies for a domain as an object.
#### wookie.unset(name)
Remove a cookie of a given name.
#### wookie.clear()
Removes all cookies for a domain.
### Tests
``` sh
npm install -g browserify
npm install -g testling
npm test
```### Licence
BSD