Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CookieService

Hierarchy

Implements

Index

Interfaces

Constructors

Properties

Methods

Constructors

constructor

Properties

Protected app

Protected opts

opts: Options

Methods

get

  • get(key: string): string | undefined
  • get(): object
  • Get the value of a cookie with the given name.

    Parameters

    • key: string

      The name of the cookie to get.

    Returns string | undefined

    The value of the cookie given by key.

  • Get all cookies.

    Returns object

    An object with all the cookie values keyed by their names.

    • [key: string]: string

init

  • init(): void

remove

  • remove(key: string, options?: CookieAttributes): void
  • Delete the cookie with the given name.

    Parameters

    • key: string

      The name of the cookie to delete.

    • Optional options: CookieAttributes

      The attributes of the cookie.

    Returns void

set

  • set(key: string, value: any, options?: CookieAttributes): void
  • Set the value of a cookie.

    Parameters

    • key: string

      The name of the cookie to set.

    • value: any

      The value of the cookie to set. Objects and arrays will be encoded as JSON before being stored.

    • Optional options: CookieAttributes

      The attributes of the cookie.

    Returns void

Generated using TypeDoc