#### [Abblix\.Oidc\.Server](https://www.abblix.com/en/docs/api/abblix-oidc-server 'index')
### [Abblix\.Oidc\.Server\.Features\.SessionManagement](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.SessionManagement 'Abblix\.Oidc\.Server\.Features\.SessionManagement')

## ISessionManagementService Interface

Provides methods and properties for managing user sessions in the context of an OpenID Connect or OAuth 2\.0 authorization server\.
This interface enables the implementation of session management features, such as creating session cookies,
generating session state values and processing check session requests\.

```csharp
public interface ISessionManagementService
```

Derived  
↳ [SessionManagementService](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.SessionManagement.SessionManagementService 'Abblix\.Oidc\.Server\.Features\.SessionManagement\.SessionManagementService')
### Properties

## ISessionManagementService\.Enabled Property {#Abblix.Oidc.Server.Features.SessionManagement.ISessionManagementService.Enabled}

Gets a value indicating whether session management is enabled and available for use in the authorization server\.
When `true`, session management features are active and can be utilized to track and manage user sessions\.

```csharp
bool Enabled { get; }
```

#### Property Value
[System\.Boolean](https://learn.microsoft.com/en-us/dotnet/api/system.boolean 'System\.Boolean')
### Methods

## ISessionManagementService\.GetCheckSessionResponseAsync\(\) Method {#Abblix.Oidc.Server.Features.SessionManagement.ISessionManagementService.GetCheckSessionResponseAsync()}

Asynchronously retrieves the response for a session check operation\. This method is called to process check session requests,
allowing the client to query the current state of the user's session and detect any changes\.

```csharp
System.Threading.Tasks.Task<Abblix.Oidc.Server.Endpoints.CheckSession.Interfaces.CheckSessionResponse> GetCheckSessionResponseAsync();
```

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[CheckSessionResponse](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.CheckSession.Interfaces.CheckSessionResponse 'Abblix\.Oidc\.Server\.Endpoints\.CheckSession\.Interfaces\.CheckSessionResponse')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
A [System\.Threading\.Tasks\.Task](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task 'System\.Threading\.Tasks\.Task') representing the asynchronous operation, yielding a [CheckSessionResponse](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.CheckSession.Interfaces.CheckSessionResponse 'Abblix\.Oidc\.Server\.Endpoints\.CheckSession\.Interfaces\.CheckSessionResponse') object that
            contains the necessary information for the client to evaluate the session state\.

## ISessionManagementService\.GetSessionCookie\(\) Method {#Abblix.Oidc.Server.Features.SessionManagement.ISessionManagementService.GetSessionCookie()}

Retrieves the session cookie that is used for managing the user's session\. This cookie can be used to persist session
information across browser requests and to facilitate session management operations\.

```csharp
Abblix.Oidc.Server.Common.Cookie GetSessionCookie();
```

#### Returns
[Cookie](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Cookie 'Abblix\.Oidc\.Server\.Common\.Cookie')  
A [Cookie](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Cookie 'Abblix\.Oidc\.Server\.Common\.Cookie') object configured for session management, containing details such as the cookie name,
            value, path, and security settings\.

## ISessionManagementService\.GetSessionState\(AuthorizationRequest, string\) Method {#Abblix.Oidc.Server.Features.SessionManagement.ISessionManagementService.GetSessionState(Abblix.Oidc.Server.Model.AuthorizationRequest,string)}

Generates a session state string that represents the current state of the user's session\. This string can be used
to validate the session's integrity and to detect session changes or logout events in a front\-channel logout scenario\.

```csharp
string GetSessionState(Abblix.Oidc.Server.Model.AuthorizationRequest request, string sessionId);
```
#### Parameters

###### `request` [AuthorizationRequest](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Model.AuthorizationRequest 'Abblix\.Oidc\.Server\.Model\.AuthorizationRequest') {#Abblix.Oidc.Server.Features.SessionManagement.ISessionManagementService.GetSessionState(Abblix.Oidc.Server.Model.AuthorizationRequest,string).request}

The authorization request context, which may contain parameters influencing the session state generation\.

###### `sessionId` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.SessionManagement.ISessionManagementService.GetSessionState(Abblix.Oidc.Server.Model.AuthorizationRequest,string).sessionId}

A unique identifier for the user's session\. This ID is used as part of the session state generation process\.

#### Returns
[System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')  
A session state string that represents the hashed state of the session, including the session ID and other relevant factors\.
