Remix Utils - v9.0.0
    Preparing search index...

    Interface TypedCookie<Schema>

    interface TypedCookie<Schema extends StandardSchemaV1> {
        expires?: Date;
        isSigned: boolean;
        isTyped: true;
        name: string;
        parse(
            cookieHeader: null | string,
            options?: ParseOptions,
        ): Promise<null | InferOutput<Schema>>;
        serialize(
            value: InferInput<Schema>,
            options?: SerializeOptions,
        ): Promise<string>;
    }

    Type Parameters

    • Schema extends StandardSchemaV1

    Hierarchy

    • Cookie
      • TypedCookie
    Index

    Properties

    expires?: Date

    The Date this cookie expires.

    Note: This is calculated at access time using maxAge when no expires option is provided to createCookie().

    isSigned: boolean

    True if this cookie uses one or more secrets for verification.

    isTyped: true
    name: string

    The name of the cookie, used in the Cookie and Set-Cookie headers.

    Methods

    • Parses a raw Cookie header and returns the value of this cookie or null if it's not present.

      Parameters

      • cookieHeader: null | string
      • Optionaloptions: ParseOptions

      Returns Promise<null | InferOutput<Schema>>

    • Serializes the given value to a string and returns the Set-Cookie header.

      Parameters

      • value: InferInput<Schema>
      • Optionaloptions: SerializeOptions

      Returns Promise<string>