HomeGuidesAPI Reference
Submit Documentation FeedbackJoin Developer CommunityOptimizely GitHubOptimizely NuGetLog 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 Type

Child Attribute

Description

session
string

N/A

The argument indicating to get session information. Required.

Return value

Parameter and Type

Child Attribute

Description

SessionObject

N/A

The object containing session information.

lastSessionTimestamp
integer

Child attribute of type SessionObject

A timestamp of when the last session was started.

sessionId
string

Child attribute of type SessionObject

A unique ID for this session. Optimizely will use this unique ID to calculate results.

Child attribute of type SessionObject

This 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"
}