Yo.utils.getCookie

Use this function to simplify the task of getting the value of a cookie, based on the name.

Prerequisites

The following command to load the appropriate version of the Rapid+JS Library must precede the use of this function on the page. Specify your own site key:

<script src="https://rapid-cdn.yottaa.com/rapid/lib/sitekey.js"></script>

Syntax

Yo.utils.getCookie('cookieName')

Returns

A string which is the contents of the cookie.

Parameters

Parameter

Description

cookieName

The name of the cookie. String.

Example

This example retrieves the contents of the shopperName cookie.

Yo.utils.getCookie('shopperName');