cookie configuration
This commit is contained in:
parent
b4edb6ae83
commit
e3c95eb109
5 changed files with 22 additions and 8 deletions
|
@ -1,10 +1,11 @@
|
|||
using Femto.Api.Auth;
|
||||
using Femto.Modules.Auth.Application.Dto;
|
||||
|
||||
namespace Femto.Api.Sessions;
|
||||
|
||||
internal static class HttpContextSessionExtensions
|
||||
{
|
||||
public static void SetSession(this HttpContext httpContext, Session session)
|
||||
public static void SetSession(this HttpContext httpContext, Session session, CookieSettings cookieSettings)
|
||||
{
|
||||
httpContext.Response.Cookies.Append(
|
||||
"session",
|
||||
|
@ -12,8 +13,8 @@ internal static class HttpContextSessionExtensions
|
|||
new CookieOptions
|
||||
{
|
||||
HttpOnly = true,
|
||||
// Secure = true,
|
||||
// SameSite = SameSiteMode.Strict,
|
||||
Secure = cookieSettings.Secure,
|
||||
SameSite = cookieSettings.SameSite? SameSiteMode.Strict : SameSiteMode.None,
|
||||
Expires = session.Expires,
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue