Transforms a domain-name into a canonical domain-name.
Transforms a domain-name into a canonical domain-name. The canonical domain-name is a trimmed, lowercased, stripped-of-leading-dot and optionally punycode-encoded domain-name (Section 5.1.2 of RFC6265). For the most part, this function is idempotent (can be run again on its output without ill effects).
the domain string
the canonical domain
For use with .sort(), sorts a list of cookies into the recommended order given in the RFC (Section 5.4 step 2).
For use with .sort(), sorts a list of cookies into the recommended order given in the RFC (Section 5.4 step 2). The sort algorithm is, in order of precedence:
Given a current request/response path, gives the Path appropriate for storing in a cookie.
Given a current request/response path, gives the Path appropriate for storing in a cookie. This is basically the "directory" of a "file" in the path, but is specified by Section 5.1.4 of the RFC.
The path parameter MUST be only the pathname part of a URI (i.e. excludes the hostname, query, fragment, etc.). This is the .pathname property of node's uri.parse() output.
Answers "does this real domain match the domain in a cookie?".
Answers "does this real domain match the domain in a cookie?". The str is the "current" domain-name and the domStr is the "cookie" domain-name. Matches according to RFC6265 Section 5.1.3, but it helps to think of it as a "suffix match".
The canonicalize parameter will run the other two paramters through canonicalDomain or not.
Format a Date into a RFC1123 string (the RFC6265-recommended format).
Format a Date into a RFC1123 string (the RFC6265-recommended format).
the given js.Date
the date-formatted string
Alias for Cookie.fromJSON(string)
Returns the public suffix of this hostname.
Returns the public suffix of this hostname. The public suffix is the shortest domain-name upon which a cookie can be set. Returns null if the hostname cannot have cookies set for it.
For example: www.example.com and www.subdomain.example.com both have public suffix example.com.
For further information, see http://publicsuffix.org/. This module derives its list from that site.
Alias for Cookie.parse(cookieString[, options])
Alias for Cookie.parse(cookieString[, options])
the given cookie string
the parsing options
Parse a cookie date string into a Date.
Parse a cookie date string into a Date. Parses according to RFC6265 Section 5.1.1, not Date.parse().
the given date string
the js.Date
Answers "does the request-path path-match a given cookie-path?" as per RFC6265 Section 5.1.4.
Answers "does the request-path path-match a given cookie-path?" as per RFC6265 Section 5.1.4. Returns a boolean.
This is essentially a prefix-match where cookiePath is a prefix of reqPath.
Generates a list of all possible domains that domainMatch() the parameter.
Generates a list of all possible domains that domainMatch() the parameter. May be handy for implementing cookie stores.
Generates a list of all possible paths that pathMatch() the parameter.
Generates a list of all possible paths that pathMatch() the parameter. May be handy for implementing cookie stores.
Tough-Cookie Object
https://www.npmjs.com/package/tough-cookie