Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Cookie

Index

Constructors

Methods

  • get(name: string): string
  • Retrieves the value of a specified cookie.

    Parameters

    • name: string

      The name of the cookie.

    Returns string

    The value of the cookie if found, otherwise null.

  • remove(name: string): void
  • Removes a specified cookie by setting its expiration date to the past.

    Parameters

    • name: string

      The name of the cookie to be removed.

    Returns void

  • set(name: string, value: string): void
  • Sets a session cookie with a specified name and value.

    Parameters

    • name: string

      The name of the cookie.

    • value: string

      The value of the cookie.

    Returns void

  • setByDays(name: string, value: string, days: number): void
  • Sets a cookie with a specified name, value, and number of days until it expires.

    Parameters

    • name: string

      The name of the cookie.

    • value: string

      The value of the cookie.

    • days: number

      The number of days until the cookie expires.

    Returns void

  • setByHours(name: string, value: string, hours?: number): void
  • Sets a cookie with a specified name, value, and number of hours until it expires.

    Parameters

    • name: string

      The name of the cookie.

    • value: string

      The value of the cookie.

    • Optional hours: number

      The number of hours until the cookie expires.

    Returns void

  • setWithExpirationDate(name: string, value: string, expirationDate: Date): void
  • Sets a cookie with a specified name, value, and a fixed expiration date.

    Parameters

    • name: string

      The name of the cookie.

    • value: string

      The value of the cookie.

    • expirationDate: Date

      The expiration date of the cookie.

    Returns void

Generated using TypeDoc