> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# NSCsSessionKey

> Carrier object for CsSessionKey.

Carrier object for CsSessionKey.

## Constructors

### NSCsSessionKey()

```crmscript theme={null}
NSCsSessionKey
```

Initializes a new instance of the NSCsSessionKey class.

## Methods

## GetKey()

```crmscript theme={null}
String GetKey()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The session key created in the login table.

**Example:**

```crmscript theme={null}
NSCsSessionKey thing;
String key = thing.GetKey();
```

## GetLoginId()

```crmscript theme={null}
Integer GetLoginId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The ID of the login row.

**Example:**

```crmscript theme={null}
NSCsSessionKey thing;
Integer loginId = thing.GetLoginId();
```

## GetUserId()

```crmscript theme={null}
Integer GetUserId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The ejuser ID owning this session key.

**Example:**

```crmscript theme={null}
NSCsSessionKey thing;
Integer userId = thing.GetUserId();
```

## SetKey(String)

```crmscript theme={null}
Void SetKey(String key)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSCsSessionKey thing;
String key;
thing.SetKey(key);
```

## SetLoginId(Integer)

```crmscript theme={null}
Void SetLoginId(Integer loginId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSCsSessionKey thing;
Integer loginId;
thing.SetLoginId(loginId);
```

## SetUserId(Integer)

```crmscript theme={null}
Void SetUserId(Integer userId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSCsSessionKey thing;
Integer userId;
thing.SetUserId(userId);
```


## Related topics

- [NSCustomerServiceAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSCustomerServiceAgent.md)
- [Namespace CRMScript.NetServer](/en/automation/crmscript/reference/CRMScript.NetServer.md)
- [SuperOffice.WebApi.Data.CsSessionKey](/en/api/reference/webapi/SuperOffice.WebApi.Data.CsSessionKey.md)
- [Session Is Valid](/en/api/reference/restful/agent/customerservice_agent/session-is-valid.md)
- [SuperOffice.WebApi.Agents.ICustomerServiceAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.ICustomerServiceAgent.md)
- [SuperOffice.WebApi.Agents.CustomerServiceAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.CustomerServiceAgent.md)
