---
title: "Boxever.getCookie(cookieName)"
slug: "bx-getcookie"
abstract: "Describes the getCookie() function in the Boxever JavaScript Library (Sitecore CDP Stream API)."
---
# Boxever.getCookie(cookieName)

The `getCookie()` functions receives a cookie name and returns the corresponding cookie value.

> [!note]
> This function only works for cookies set by the Boxever JavaScript Library and for cookies set using the `[setCookie()](bx-setcookie.html "Boxever.setCookie(cookieName, cookieValue[, expiresIn])")` function.

## Parameters

| Parameter | Type | Description | Note |
| --- | --- | --- | --- |
| `cookieName` | string or number | The name of the cookie. | N/A |

## Return value

string

## Example

Call the `getCookie()` function:

```javascript
console.log(Boxever.getCookie("_example_cookie_name_"));
// "_example_cookie_value_"

```