Class: CookieJar

CookieJar()

CookieJar is a simple container for cookies.
addCookiesFromHeader will take a Cookie header string from the request and parse out the cookie keys and values.
toHeader will take all the cookies in the CookieJar and create a Cookie header string.

Constructor

new CookieJar()

Initialize and empty CookieJar.
Source:

Methods

addCookiesFromHeader(cookieHeader)

Adds all the cookies from the request's Cookie header to the CookieJar.
Parameters:
Name Type Description
cookieHeader String The cookie header from the request
Source:

get(key)

Retrieve a cookie from the CookieJar.
Parameters:
Name Type Description
key String The key of the cookie
Source:

set(key, value)

Add a cookie to the CookieJar.
Parameters:
Name Type Description
key String The key of the cookie
value String The value of the cookie
Source:

toHeader()

Formats all the current cookies in the CookieJar as a string that can be set as the response Cookie header.
Source: