Skip to main content

Cookie <T>

Index

Constructors

Accessors

Methods

Constructors

constructor

  • Type parameters

    • T: Record<string, any>

    Parameters

    Returns Cookie<T>

Accessors

attributes

Methods

get

  • get<Name>(name: Name): null | T[Name]
  • Get cookie value


    Type parameters

    • Name: string

    Parameters

    • name: Name

      cookie name

    Returns null | T[Name]

    cookie value or null if cookie does not exist

has

  • has<Name>(name: Name): boolean
  • Check if cookie exists


    Type parameters

    • Name: string

    Parameters

    • name: Name

      cookie name

    Returns boolean

list

  • list<Cookies>(): Cookies
  • Get all cookies


    Type parameters

    • Cookies = T

    Returns Cookies

    all document cookies

remove

  • Remove cookie


    Type parameters

    • Name: string

    Parameters

    Returns void

set

  • set<Name>(name: Name, value: null | T[Name], attributes?: CookieAttributes): void
  • Set cookie value


    Type parameters

    • Name: string

    Parameters

    • name: Name

      cookie name

    • value: null | T[Name]

      cookie value

    • optionalattributes: CookieAttributes

      cookie attributes

    Returns void