Home Flows Cookie Recipe

Cookie Recipe

Last updated on Dec 10, 2024

Introduction

Cookies in Evo Voice enable the storage of arbitrary string data associated with a unique identifier, such as caller ID or user name. Similar to web cookies, they consist of a name and a value but are stored in the database linked to the incoming identifier.

Usage

Three main nodes facilitate cookie handling: Get Cookie Node, Set Cookie Node, and Delete Cookie Node.

Example

Consider a simple example where we greet users differently based on whether a cookie exists. If the cookie exists, we welcome them back; otherwise, we prompt them for their name and save it in a cookie.

Flow Overview

Get Cookie Node

  • Retrieves a cookie named "Name" and stores it in the flow parameter "Name."

  • Transition: Found if the cookie exists; Not Found if not.

Prompt Node

  • Prompts the user for their name.

  • Stores the name in the flow parameter.

Set Cookie Node

Flows - set cookie node

  • Sets a cookie named "Name" with the value obtained from the user input.

Greeting Node

  • Greets the user using the stored name.

Flow Execution

  1. On the first run, since the cookie doesn't exist, the prompt node collects the user's name.

  2. The name is stored in the flow parameter and used to set a cookie.

  3. The user is greeted.

  4. On subsequent runs, the existing cookie is retrieved, and the user is greeted using a template.

Conclusion

With Evo Voice's cookie functionality, personalized user experiences can be created by storing and retrieving user-specific data efficiently.