Skip to content

Latest commit

 

History

History
147 lines (66 loc) · 2.37 KB

tough-cookie.getcookiesoptions.md

File metadata and controls

147 lines (66 loc) · 2.37 KB

Home > tough-cookie > GetCookiesOptions

GetCookiesOptions interface

Configuration options used when calling CookieJar.getCookies(...).

Signature:

export interface GetCookiesOptions 

Properties

Property

Modifiers

Type

Description

allPaths?

boolean | undefined

(Optional) If true, do not scope cookies by path. If false, then RFC-compliant path scoping will be used.

expire?

boolean | undefined

(Optional) Perform expiry-time checking of cookies and asynchronously remove expired cookies from the store.

http?

boolean | undefined

(Optional) Indicates if this is an HTTP or non-HTTP API. Affects HttpOnly cookies.

Defaults to true if not provided.

sameSiteContext?

'none' | 'lax' | 'strict' | undefined

(Optional) Set this to 'none', 'lax', or 'strict' to enforce SameSite cookies upon retrieval.

  • 'strict' - If the request is on the same "site for cookies" (see the RFC draft for more information), pass this option to add a layer of defense against CSRF.

  • 'lax' - If the request is from another site, but is directly because of navigation by the user, such as, <link type=prefetch> or <a href="...">, then use lax.

  • 'none' - This indicates a cross-origin request.

  • undefined - SameSite is not be enforced! This can be a valid use-case for when CSRF isn't in the threat model of the system being built.

Defaults to undefined if not provided.

sort?

boolean | undefined

(Optional) Flag to indicate if the returned cookies should be sorted or not.

Defaults to undefined if not provided.