Amplify JS API Documentation
    Preparing search index...
    interface Adapter {
        delete(name: string): void;
        get(name: string): Cookie | undefined;
        getAll(): Cookie[];
        set(
            name: string,
            value: string,
            options?: Partial<
                Pick<
                    CookieSerializeOptions,
                    | "domain"
                    | "expires"
                    | "httpOnly"
                    | "maxAge"
                    | "sameSite"
                    | "secure"
                    | "path",
                >,
            >,
        ): void;
    }
    Index

    Methods

    • Delete a cookie from the storage.

      Parameters

      • name: string

        The name of the cookie.

      Returns void

    • Get a cookie from the storage.

      Parameters

      • name: string

        The name of the cookie.

      Returns Cookie | undefined

    • Get all cookies from the storage.

      Returns Cookie[]

    • Set a cookie in the storage.

      Parameters

      • name: string

        The name of the cookie.

      • value: string

        The value of the cookie.

      • Optionaloptions: Partial<
            Pick<
                CookieSerializeOptions,
                | "domain"
                | "expires"
                | "httpOnly"
                | "maxAge"
                | "sameSite"
                | "secure"
                | "path",
            >,
        >

        The cookie's options.

      Returns void