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

## SessionIdGenerator Class

Implements the [ISessionIdGenerator](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.RandomGenerators.ISessionIdGenerator 'Abblix\.Oidc\.Server\.Features\.RandomGenerators\.ISessionIdGenerator') interface to generate unique session identifiers\.
The session IDs are generated using a cryptographically strong random number generator and are encoded
to be safely included in HTTP URLs, avoiding characters that might cause issues in URLs\.

```csharp
public class SessionIdGenerator : Abblix.Oidc.Server.Features.RandomGenerators.ISessionIdGenerator
```

Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') → SessionIdGenerator

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

## SessionIdGenerator\(IOptions\<OidcOptions\>\) Constructor {#Abblix.Oidc.Server.Features.RandomGenerators.SessionIdGenerator.SessionIdGenerator(Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_)}

Implements the [ISessionIdGenerator](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.RandomGenerators.ISessionIdGenerator 'Abblix\.Oidc\.Server\.Features\.RandomGenerators\.ISessionIdGenerator') interface to generate unique session identifiers\.
The session IDs are generated using a cryptographically strong random number generator and are encoded
to be safely included in HTTP URLs, avoiding characters that might cause issues in URLs\.

```csharp
public SessionIdGenerator(Microsoft.Extensions.Options.IOptions<Abblix.Oidc.Server.Common.Configuration.OidcOptions> options);
```
#### Parameters

###### `options` [Microsoft\.Extensions\.Options\.IOptions&lt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.options.ioptions-1 'Microsoft\.Extensions\.Options\.IOptions\`1')[OidcOptions](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Configuration.OidcOptions 'Abblix\.Oidc\.Server\.Common\.Configuration\.OidcOptions')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.options.ioptions-1 'Microsoft\.Extensions\.Options\.IOptions\`1') {#Abblix.Oidc.Server.Features.RandomGenerators.SessionIdGenerator.SessionIdGenerator(Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_).options}
### Methods

## SessionIdGenerator\.GenerateSessionId\(\) Method {#Abblix.Oidc.Server.Features.RandomGenerators.SessionIdGenerator.GenerateSessionId()}

Generates a new session identifier\. The method employs a cryptographically strong random number generator
to produce a sequence of bytes, which are then URL\-encoded to ensure they can be safely used within HTTP URLs\.
This approach ensures that the session identifiers are highly unlikely to collide and are secure for use in
web applications\.

```csharp
public string GenerateSessionId();
```

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

#### Returns
[System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')  
A string representing a URL\-safe, cryptographically strong random session identifier\. The identifier
            is encoded in a way that makes it suitable for use in HTTP URLs, cookies, or any other URL\-based contexts\.
