@consumidor-positivo/ts-utils - v1.16.0
    Preparing search index...

    Type Alias SetCookieOptions

    Options for setting a cookie

    type SetCookieOptions = {
        domain?: string;
        expiresDate?: Date;
        maxAge?: number;
        path?: string;
        sameSite?: "Strict" | "Lax" | "None";
        secure?: boolean;
    }
    Index

    Properties

    domain?: string

    Cookie domain. If not set, defaults to the current domain.

    expiresDate?: Date

    Cookie expiration as a Date object. If not set, the cookie will be a session cookie.

    maxAge?: number

    Maximum age of the cookie in seconds.

    path?: string

    Cookie path. Defaults to '/'.

    sameSite?: "Strict" | "Lax" | "None"

    SameSite attribute for the cookie.

    • 'Strict': Cookie is only sent in first-party context
    • 'Lax': Cookie is sent in first-party context and top-level navigations
    • 'None': Cookie is sent in all contexts (requires Secure attribute)
    secure?: boolean

    Whether the cookie should only be transmitted over secure protocol (HTTPS).