# WithApp Method

## Overloads

| [WithApp(String, SessionType)](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Session.WithApp.htm#Qlik_Engine_Session_WithApp_System_String_Qlik_Engine_SessionType_) |  | Initializes an app specific session<br><br><table><thead><tr><th>SessionType</th><th>Behavior</th></tr></thead><tr><td>SessionType.Default</td><td>Connects to a app session shared with the Qlik Sense web client</td></tr><tr><td>SessionType.Random</td><td>Connects to a globally unique app session</td></tr></table> |
| --- | --- | --- |
| [WithApp(IAppIdentifier, SessionType)](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Session.WithApp.htm#Qlik_Engine_Session_WithApp_Qlik_Engine_IAppIdentifier_Qlik_Engine_SessionType_) |  | Initializes an app specific session<br><br><table><thead><tr><th>SessionType</th><th>Behavior</th></tr></thead><tr><td>SessionType.Default</td><td>Connects to a app session shared with the Qlik Sense web client</td></tr><tr><td>SessionType.Random</td><td>Connects to a globally unique app session</td></tr></table> |
| [WithApp(String, String)](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Session.WithApp.htm#Qlik_Engine_Session_WithApp_System_String_System_String_) |  | Initializes a app specific session with a custom session token |
| [WithApp(IAppIdentifier, String)](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Session.WithApp.htm#Qlik_Engine_Session_WithApp_Qlik_Engine_IAppIdentifier_System_String_) |  | Initializes a app specific session with a custom session token |

[](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Session.WithApp.htm) [](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Session.WithApp.htm)

## WithApp(String, SessionType)

Initializes an app specific session

| SessionType | Behavior |
| --- | --- |
| SessionType.Default | Connects to a app session shared with the Qlik Sense web client |
| SessionType.Random | Connects to a globally unique app session |

### Declaration

```

          public static ISession WithApp(string appId, SessionType sessionType)
    
  
```

### Parameters

| Type | Name | Description |
| --- | --- | --- |
| System.String | appId | ID of the app to attach the session to |
| [SessionType](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.SessionType.htm) | sessionType | the wanted session type |

### Returns

| Type | Description |
| --- | --- |
| [ISession](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.ISession.htm) | a session identifier |

### Examples

```
// create a session that is private
ISession privateSession = Session.WithApp(appIdentifier, SessionType.Random);
```

[](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Session.WithApp.htm) [](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Session.WithApp.htm)

## WithApp(IAppIdentifier, SessionType)

Initializes an app specific session

| SessionType | Behavior |
| --- | --- |
| SessionType.Default | Connects to a app session shared with the Qlik Sense web client |
| SessionType.Random | Connects to a globally unique app session |

### Declaration

```

          public static ISession WithApp(IAppIdentifier appIdentifier, SessionType sessionType)
    
  
```

### Parameters

| Type | Name | Description |
| --- | --- | --- |
| [IAppIdentifier](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.IAppIdentifier.htm) | appIdentifier | application identifier to attach the session to |
| [SessionType](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.SessionType.htm) | sessionType | the wanted session type |

### Returns

| Type | Description |
| --- | --- |
| [ISession](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.ISession.htm) | a session identifier |

### Examples

```
// create a session that is private
ISession privateSession = Session.WithApp(appIdentifier, SessionType.Random);
```

[](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Session.WithApp.htm) [](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Session.WithApp.htm)

## WithApp(String, String)

Initializes a app specific session with a custom session token

### Declaration

```
public static ISession WithApp(string appId, string sessionToken = null)
```

### Parameters

| Type | Name | Description |
| --- | --- | --- |
| System.String | appId | ID of the app to attach the session to |
| System.String | sessionToken | a custom session token |

### Returns

| Type | Description |
| --- | --- |
| [ISession](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.ISession.htm) | a session identifier |

### Examples

```
// create a session that synchronizes with the Qlik Sense client
ISession syncedSession = Session.WithApp(appIdentifier);

// create a session that synchronizes with other clients using the same token
ISession privateSession = Session.WithApp(appIdentifier, "MySpecificSession");
```

[](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Session.WithApp.htm) [](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Session.WithApp.htm)

## WithApp(IAppIdentifier, String)

Initializes a app specific session with a custom session token

### Declaration

```
public static ISession WithApp(IAppIdentifier appIdentifier, string sessionToken = null)
```

### Parameters

| Type | Name | Description |
| --- | --- | --- |
| [IAppIdentifier](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.IAppIdentifier.htm) | appIdentifier | application identifier to attach the session to |
| System.String | sessionToken | a custom session token |

### Returns

| Type | Description |
| --- | --- |
| [ISession](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.ISession.htm) | a session identifier |

### Examples

```
// create a session that synchronizes with the Qlik Sense client
ISession syncedSession = Session.WithApp(appIdentifier);

// create a session that synchronizes with other clients using the same token
ISession privateSession = Session.WithApp(appIdentifier, "MySpecificSession");
```