# OpcSession Class

<dl class="api-definition">
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx.server">Opc.UaFx.Server</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
<dt>Members</dt>
<dd><a href="./members">OpcSession Members</a></dd>
</dl>

Represents a session which a client has created on the server.

## Syntax

<div class="api-signature" data-lang="csharp">

```csharp
public class OpcSession
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Class OpcSession
```

</div>

## Inheritance

[Object](https://learn.microsoft.com/dotnet/api/system.object) → **OpcSession**

## Implements

<ul class="api-implements">
<li><a href="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a></li>
</ul>

## Properties

| Name | Description |
|---|---|
| [Certificate](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsession/members#certificate) | Gets the certificate of the client. |
| [ConnectTime](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsession/members#connecttime) | Gets the time at which the client has created the session. |
| [Diagnostics](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsession/members#diagnostics) | Gets the diagnostic information about the session. |
| [EndpointUrl](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsession/members#endpointurl) | Gets the URL of the endpoint through which the client has created the session. |
| [Id](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsession/members#id) | Gets the identifier of the session. |
| [IsActive](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsession/members#isactive) | Gets a value indicating whether the session has been activated. |
| [IsExpired](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsession/members#isexpired) | Gets a value indicating whether the session has expired. |
| [LastContactTime](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsession/members#lastcontacttime) | Gets the time of the last contact with the client. |
| [Name](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsession/members#name) | Gets the name of the session. |
| [PreferredLocales](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsession/members#preferredlocales)<span class="api-meta">since v2.11</span> | Gets a collection of preferred locales (see [Name](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo.name)) to use to localize data and information. |
| [ServerUri](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsession/members#serveruri) | Gets the URI of the server recorded in the diagnostic information about the session. |
| [Socket](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsession/members#socket)<span class="api-meta">since v2.7</span> | Gets the identity of the socket through which the client has created the session. |
| [SuppliedIdentity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsession/members#suppliedidentity) | Gets the user identity which the client has supplied. |
| [UsedIdentity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsession/members#usedidentity) | Gets the user identity which the server uses for the session. |

## Methods

| Name | Description |
|---|---|
| [Close](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsession/members#close) | Closes the session. |
| [Dispose](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsession/members#dispose)<span class="api-meta">2 overloads</span> | Releases all resources used by the OpcSession. |
| [GetSubscriptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsession/members#getsubscriptions)<span class="api-meta">since v2.50</span> | Provides a sequence of [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsubscription/) instances associated with this OpcSession. |

## Applies to

| Package | Versions |
|---|---|
| Opc.UaFx.Advanced | v2.5–v2.59 |
