Configuration definition for instance based cookie management configuration

interface ICookieMgrConfig {
    blockedCookies?: string[];
    delCookie?: ((name: string, cookieValue: string) => void);
    domain?: string;
    enabled?: boolean;
    getCookie?: ((name: string) => string);
    ignoreCookies?: string[];
    path?: string;
    setCookie?: ((name: string, value: string) => void);
}

Properties

blockedCookies?: string[]

Specify the cookie name(s) to never be written, this will cause any cookie name to never be created or updated, they will still be read unless also included in the ignoreCookies and may still be explicitly purged or deleted. If not provided defaults to the same list provided in ignoreCookies. (Since v2.8.8)

delCookie?: ((name: string, cookieValue: string) => void)

Hook function to delete the named cookie with the specified value, separated from setCookie to avoid the need to parse the value to determine whether the cookie is being added or removed.

Type declaration

    • (name, cookieValue): void
    • Parameters

      • name: string

        The name of the cookie

      • cookieValue: string

        The value to set to expire the cookie

      Returns void

domain?: string

Custom cookie domain. This is helpful if you want to share Application Insights cookies across subdomains.

enabled?: boolean

Defaults to true, A boolean that indicates whether the use of cookies by the SDK is enabled by the current instance. If false, the instance of the SDK initialized by this configuration will not store or read any data from cookies

getCookie?: ((name: string) => string)

Hook function to fetch the named cookie value.

Type declaration

    • (name): string
    • Parameters

      • name: string

        The name of the cookie

      Returns string

ignoreCookies?: string[]

Specify the cookie name(s) to be ignored, this will cause any matching cookie name to never be read or written. They may still be explicitly purged or deleted. You do not need to repeat the name in the blockedCookies configuration.(Since v2.8.8)

path?: string

Specifies the path to use for the cookie, defaults to '/'

setCookie?: ((name: string, value: string) => void)

Hook function to set the named cookie with the specified value.

Type declaration

    • (name, value): void
    • Parameters

      • name: string

        The name of the cookie

      • value: string

        The value to set for the cookie

      Returns void