• /
  • EnglishEspañol日本語한국어Português
  • Log inStart now

Current session ID

Syntax

Java

NewRelic.currentSessionId()

Kotlin

NewRelic.currentSessionId()

Description

Returns ID for current session.

This method is useful for consolidating monitoring of app data (not just New Relic data) based on a single session definition and identifier. For example, you might want to use the same identifier for marketing analytics, or user analytics.

Compatible with all agent versions.

Return values

Returns ID string for the current session.

Example

Java

String sessionId = NewRelic.currentSessionId();

Kotlin

val sessionId = NewRelic.currentSessionId()

Syntax

Objective-c

+ (NSString* _Null_unspecified) currentSessionId;

Swift

NewRelic.currentSessionId()

Description

Returns the current session ID. This method is useful for consolidating monitoring of app data (not just New Relic data) based on a single session definition and identifier. For example, you might want to use the same identifier for marketing analytics or user analytics. This session ID will change every time the app comes to the foreground.

Return values

Returns ID string for the current session.

Examples

Objective-C

NSString* sessionId = [NewRelic currentSessionId()];

Swift

let sessionId = NewRelic.currentSessionId()

Syntax

currentSessionId(options?: {} | undefined) => Promise<{ sessionId: string; }>

Description

Returns the current session ID. This method is useful for consolidating monitoring of app data (not just New Relic data) based on a single session definition and identifier.

Return values

Returns ID string for the current session.

Example

let { sessionId } = await NewRelicCapacitorPlugin.currentSessionId();

Syntax

currentSessionId(): Promise<sessionId>;

Description

Returns the current session ID. This method is useful for consolidating monitoring of app data (not just New Relic data) based on a single session definition and identifier.

Return values

Returns ID string for the current session.

Example

let sessionId = await NewRelic.currentSessionId();

Syntax

CurrentSessionId() : string;

Description

Returns the current session ID. This method is useful for consolidating monitoring of app data (not just New Relic data) based on a single session definition and identifier.

Return values

Returns ID string for the current session.

Example

string sessionId = CrossNewRelic.Current.CurrentSessionId();

Syntax

currentSessionId(): Promise;

Description

Returns the current session ID. This method is useful for consolidating monitoring of app data (not just New Relic data) based on a single session definition and identifier.

Return values

Returns ID string for the current session.

Example

var sessionId = await NewrelicMobile.instance.currentSessionId();

Syntax

currentSessionId(): Promise;

Description

Returns the current session ID. This method is useful for consolidating monitoring of app data (not just New Relic data) based on a single session definition and identifier.

Return values

Returns ID string for the current session.

Example

let sessionId = await NewRelic.currentSessionId();

Syntax

currentSessionId() : string;

Description

Returns the current session ID. This method is useful for consolidating monitoring of app data (not just New Relic data) based on a single session definition and identifier.

Return values

Returns ID string for the current session.

Example

string sessionId = NewRelicAgent.CurrentSessionId();

Syntax

currentSessionId() : FString;

Description

Returns the current session ID. This method is useful for consolidating monitoring of app data (not just New Relic data) based on a single session definition and identifier.

Return values

Returns ID string for the current session.

Example

#include "NewRelicBPLibrary.h"
FString id = UNewRelicBPLibrary::currentSessionId();

Syntax

CurrentSessionId() : string;

Description

Returns the current session ID. This method is useful for consolidating monitoring of app data (not just New Relic data) based on a single session definition and identifier.

Return values

Returns ID string for the current session.

Example

string sessionId = CrossNewRelic.Current.CurrentSessionId();
Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.