tough-cookie.createcookiejaroptions.allowsecureonlocal.md
July 22, 2026 ยท View on GitHub
Home > tough-cookie > CreateCookieJarOptions > allowSecureOnLocal
CreateCookieJarOptions.allowSecureOnLocal property
Flag to indicate if localhost and loopback addresses with an insecure scheme should store and retrieve Secure cookies.
If true, localhost, loopback addresses or similarly local addresses are treated as secure contexts and thus will store and retrieve Secure cookies even with an insecure scheme.
If false, only secure schemes (https and wss) will store and retrieve Secure cookies.
Signature:
allowSecureOnLocal?: boolean | undefined;
Remarks
When set to true, the potentially trustworthy algorithm is followed to determine if a URL is considered a secure context.