21 lines
No EOL
550 B
C#
21 lines
No EOL
550 B
C#
using Femto.Modules.Auth.Application.Dto;
|
|
|
|
namespace Femto.Api.Sessions;
|
|
|
|
internal static class HttpContextSessionExtensions
|
|
{
|
|
public static void SetSession(this HttpContext httpContext, Session session)
|
|
{
|
|
httpContext.Response.Cookies.Append(
|
|
"session",
|
|
session.SessionId,
|
|
new CookieOptions
|
|
{
|
|
HttpOnly = true,
|
|
// Secure = true,
|
|
// SameSite = SameSiteMode.Strict,
|
|
Expires = session.Expires,
|
|
}
|
|
);
|
|
}
|
|
} |