femto-backend/Femto.Api/Sessions/HttpContextSessionExtensions.cs
2025-05-15 17:47:20 +02:00

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,
}
);
}
}