Home Step Guides Cookies Setup Guide

Cookies Setup Guide

Last updated on Jan 10, 2025

Cookies allow storing arbitrary string data against a unique calling identifier, like caller ID or username. They mimic web cookies, but are stored in the database.

Usage:

There are three main nodes: Get Cookie, Set Cookie, and Delete Cookie.

Example:

Scenario: Check if a cookie exists for incoming message. If yes, welcome back; if not, prompt for name and save in a cookie.

Flow:

  1. Get Cookie Node:

  • Retrieves a cookie based on its name.

  • If found, goes to Found transition; else, Not Found.

  1. Prompt Node:

  • Collects information (e.g., name) from sender.

  • Stores the name in Flow Parameter.

  1. Set Cookie Node:

    • Sets a cookie for the collected name.
  2. Greet Node:

  • Greets the person using the collected name.

Example Execution:

  1. First Time:

    • Cookie doesn't exist.

    • Prompts for name.

    • Stores name in Flow Parameter.

    • Sets cookie with the name.

    • Greets the person.

  2. Subsequent Times:

    • Cookie exists.

    • Retrieves the cookie.

    • Greets using the stored name.

Follow these steps to implement cookie functionality effectively in your flow.