ActiveCampaign
Also available forKeap

[memb_cookie]

Summary
Displays the results of a cookie

Description

This shortcode reads a value from the $_COOKIE superglobal and displays it on the page. It is commonly used to access browser cookie values set by your site or third-party scripts.

Shortcode Examples

Read a cookie named source:

[memb_cookie name="source"]

Display a cookie value with a fallback if it does not exist:

[memb_cookie name="source" default="direct"]

Read the PHP session ID cookie:

[memb_cookie name="PHPSESSID"]

Apply text formatting to the output:

[memb_cookie name="source" txtfmt="strtoupper"]

Shortcode Parameters

name(Required) Comma-delimited list of keys to look up in the $_COOKIE variable.
defaultThe default value to use if the key is empty. Defaults to an empty string.
txtfmt(Optional) Comma-delimited list of text processing functions to apply to the output.
captureCaptures the shortcode output and routes it to a variable for later use.
beforeText to display before the output value.
afterText to display after the output value.
htmlattrIf set, outputs the value as an HTML attribute rather than as visible text.

Additional Information

Using [memb_cookie] with no parameters displays all $_COOKIE variables for debugging purposes. Cookie availability depends on the cookie’s path and domain settings—a cookie set for a subdomain or specific path may not be visible on the current page.

Shortcode Attributes

ConditionalNo
NestableNo
Accepts formattingYes
CapturableYes