This commit is contained in:
john 2025-05-14 23:53:00 +02:00
parent baea64229b
commit 0dc41337da
36 changed files with 324 additions and 95 deletions

View file

@ -0,0 +1,21 @@
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,
}
);
}
}