-
Notifications
You must be signed in to change notification settings - Fork 2
/
SessionMiddlewareOptions.cs
42 lines (36 loc) · 1.56 KB
/
SessionMiddlewareOptions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
using System.Security.Cryptography;
namespace OwinSessionMiddleware
{
/// <summary>
/// Options class for the <see cref="SessionMiddleware"/> class.
/// </summary>
public class SessionMiddlewareOptions
{
/// <summary>
/// The name of the session cookie.
/// </summary>
public string CookieName { get; set; } = SessionMiddlewareDefaults.CookieName;
/// <summary>
/// The domain of the session cookie.
/// </summary>
public string CookieDomain { get; set; } = null;
/// <summary>
/// The lifetime of the session cookie. Set to null for a cookie that is bound to the browser session (default).
/// </summary>
public TimeSpan? CookieLifetime { get; set; } = null;
/// <summary>
/// Secure cookies are only sent by the browser over HTTPS. This setting is enabled by default.
/// </summary>
public bool UseSecureCookie { get; set; } = true;
/// <summary>
/// The session store.
/// </summary>
public ISessionStore Store { get; set; } = new InMemorySessionStore();
/// <summary>
/// A <see cref="Func{String}"/> that will be called whenever a new session id needs to be generated.
/// Default implementation is based on a unique <see cref="Guid"/> combined with a random part generated by <see cref="RNGCryptoServiceProvider"/>.
/// </summary>
public Func<string> UniqueSessionIdGenerator { get; set; } = SessionMiddlewareDefaults.UniqueSessionIdGenerator;
}
}