Keap
Also available forActiveCampaign

[memb_session]

Summary
Shortcode function to display data from the current login session.

Description

This shortcode reads a value from the $_SESSION superglobal and displays it on the page. It is commonly used to access PHP session data for the current visitor, such as login state or session-scoped variables.

Shortcode Examples

Read a session variable named source:

[memb_session name="source"]

Display a session value with a fallback:

[memb_session name="source" default="organic"]

Check whether the visitor is logged in:

[memb_session name="is_logged_in" default="0"]

Apply text formatting to the output:

[memb_session name="source" txtfmt="ucfirst"]

Shortcode Parameters

name(Required) Comma-delimited list of keys to look up in the $_SESSION 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_session] with no parameters displays all $_SESSION variables for debugging purposes. Session data is only available after a session has been started with session_start() or equivalent. Memberium automatically manages sessions for logged-in members.

Shortcode Attributes

ConditionalNo
NestableNo
Accepts formattingYes
CapturableYes