parse-cookie-phantomjs 
> Parse a cookie for use in PhantomJS
Accepts a cookie string and returns an object ready to be passed into phantom.addCookie().
Install
$ npm install --save parse-cookie-phantomjs
Usage
var parseCookiePhantomjs = require('parse-cookie-phantomjs');
parseCookiePhantomjs('foo=bar; Path=/; Domain=localhost');
/*
{
name: 'foo',
value: 'bar',
domain: 'localhost',
path: '/',
httponly: false,
secure: false,
expires: 'Infinity'
}
*/
License
MIT © Sindre Sorhus
Source
| 1 | # parse-cookie-phantomjs [](https://travis-ci.org/sindresorhus/parse-cookie-phantomjs) |
| 2 | |
| 3 | > Parse a cookie for use in PhantomJS |
| 4 | |
| 5 | Accepts a cookie string and returns an object ready to be passed into [`phantom.addCookie()`](http://phantomjs.org/api/phantom/method/add-cookie.html). |
| 6 | |
| 7 | |
| 8 | ## Install |
| 9 | |
| 10 | ```sh |
| 11 | $ npm install --save parse-cookie-phantomjs |
| 12 | ``` |
| 13 | |
| 14 | |
| 15 | ## Usage |
| 16 | |
| 17 | ```js |
| 18 | var parseCookiePhantomjs = require('parse-cookie-phantomjs'); |
| 19 | |
| 20 | parseCookiePhantomjs('foo=bar; Path=/; Domain=localhost'); |
| 21 | /* |
| 22 | { |
| 23 | name: 'foo', |
| 24 | value: 'bar', |
| 25 | domain: 'localhost', |
| 26 | path: '/', |
| 27 | httponly: false, |
| 28 | secure: false, |
| 29 | expires: 'Infinity' |
| 30 | } |
| 31 | */ |
| 32 | ``` |
| 33 | |
| 34 | |
| 35 | ## License |
| 36 | |
| 37 | MIT © [Sindre Sorhus](http://sindresorhus.com) |