Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideProduct feedbackGitHubNuGetDev CommunitySubmit a ticketLog In

Session

Get metadata for the current session. - Deprecated.

🚧

Deprecation warning

This API is deprecated and was removed in March 2018. You can use the session_index field if you are looking to query for events from a particular session.

Syntax

session = window["optimizely"].get("session");

Parameters

Parameter and TypeChild AttributeDescription
session
string
N/AThe argument indicating to get session information. Required.

Return value

Parameter and TypeChild AttributeDescription
SessionObjectN/AThe object containing session information.
lastSessionTimestamp
integer
Child attribute of type SessionObjectA timestamp of when the last session was started.
sessionId
string
Child attribute of type SessionObjectA unique ID for this session. Optimizely Web Experimentation will use this unique ID to calculate results.
*
*
Child attribute of type SessionObjectThis object can contain project- or environment-specific properties that are not predefined.

Example Call

session = window["optimizely"].get("session");

Example Return Value

{
  "lastSessionTimestamp": 1476765927360,
  "sessionId": "b6d3c104-2057-408e-acfe-8ca554713d8f"
}