Skip to content

GetID()

ts
GetID(): string;

Retrieves the current session’s unique ID as a string.

NOTE

The session ID uniquely identifies each client session and can be used for logging, auditing, or correlating events.

Example

ts
{
  if (Session) {
    var sid = Session.GetID();
    // sid will contain a string like "prDqzL4V5jkauJZP9Nmt2e"
  } else {
    Log('Session object is not available.');
  }
}

TIP

The session ID is only available after a client session has been established. In event-handlers that run before a session exists, Session will be null.