React Router API Reference
    Preparing search index...

    Interface CookieParseOptions

    Parse options.

    interface CookieParseOptions {
        allowMultiple?: boolean;
        decode?: (str: string) => string | undefined;
        filter?(key: string): boolean;
    }
    Index

    Properties

    Methods

    Properties

    allowMultiple?: boolean

    When enabled, duplicate cookie names will return an array of values instead of only the first value.

    decode?: (str: string) => string | undefined

    Specifies a function that will be used to decode a cookie-value. Since the value of a cookie has a limited character set (and must be a simple string), this function can be used to decode a previously-encoded cookie value into a JavaScript string.

    The default function is the global decodeURIComponent, wrapped in a try..catch. If an error is thrown it will return the cookie's original value. If you provide your own encode/decode scheme you must ensure errors are appropriately handled.

    decode
    

    Methods

    • Custom function to filter parsing specific keys.

      Parameters

      • key: string

      Returns boolean