Class: CookieJar

CookieJar

new CookieJar(store)

Holds cookies
Parameters:
Name Type Description
store Object [optional] the toJSON value of another CookieJar
Source:

Methods

add(data, url, options)

Add a cookie to the cookie jar
Parameters:
Name Type Description
data String | Object can be a Cookie|json object or a set-cookie header string
url String
options Object [optional]
Source:

getCookieHeaderString(url, options) → {String}

Get HTTP Cookie header string
Parameters:
Name Type Description
url String
options Object [optional]
Source:
Returns:
HTTP Cookie header string
Type
String

getCookies(url, options) → {Array}

Get cookies that match the given properties
Parameters:
Name Type Description
url String
options Object [optional]
Source:
Returns:
array of Cookie objects
Type
Array

remove(url, key)

Remove a cookie by name for a given domain. If the key then all cookies for the given domain and path (if given) will be removed. Note: when cookies are added without a path specified the default path is "/" in accordance with http://tools.ietf.org/search/rfc6265#section-5.1.4 - so you should use that for the path param when appropriate.
Parameters:
Name Type Description
url String
key String
Source:

toJSON() → {Object}

Get cookie jar as a JSON object
Source:
Returns:
Type
Object