Documentation
    Preparing search index...

    Cookie client exposes the API to parse/set AdonisJS cookies as a client.

    Index

    Constructors

    Methods

    • Encrypt a key value pair to be sent in the cookie header

      Parameters

      • key: string

        The cookie key

      • value: any

        The value to encrypt

      Returns null | string

      The encrypted cookie string or null if encryption fails

    • Sign a key value pair to be sent in the cookie header

      Parameters

      • key: string

        The cookie key

      • value: any

        The value to sign

      Returns null | string

      The signed cookie string or null if signing fails

    • Encode a key value pair to be sent in the cookie header

      Parameters

      • _: string

        Unused key parameter

      • value: any

        The value to encode

      • stringify: boolean = true

        Whether to stringify the value before encoding

      Returns null | string

      The encoded cookie string or null if encoding fails

    • Unsign a signed cookie value

      Parameters

      • key: string

        The cookie key

      • value: string

        The signed cookie value to unsign

      Returns any

      The original value if valid signature, null otherwise

    • Decrypt an encrypted cookie value

      Parameters

      • key: string

        The cookie key

      • value: string

        The encrypted cookie value to decrypt

      Returns any

      The decrypted value or null if decryption fails

    • Decode an encoded cookie value

      Parameters

      • _: string

        Unused key parameter

      • value: string

        The encoded cookie value to decode

      • stringified: boolean = true

        Whether the value was stringified during encoding

      Returns any

      The decoded value or null if decoding fails

    • Parse response cookie

      Parameters

      • key: string

        The cookie key

      • value: any

        The cookie value to parse

      Returns any

      The parsed value or undefined if parsing fails