From 9a447db8914a7a8c322a4c6f2c3584d44ee64e33 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Sun, 25 Feb 2024 14:17:11 +0000 Subject: [PATCH] fix: expire sid after 30 days --- OliverBooth/Services/SessionService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OliverBooth/Services/SessionService.cs b/OliverBooth/Services/SessionService.cs index 7a0bb32..ab1a2ae 100644 --- a/OliverBooth/Services/SessionService.cs +++ b/OliverBooth/Services/SessionService.cs @@ -98,7 +98,7 @@ internal sealed class SessionService : BackgroundService, ISessionService IPAddress? remoteIpAddress = response.HttpContext.Connection.RemoteIpAddress; _logger.LogDebug("Writing cookie 'sid' to HTTP response for {RemoteAddr}", remoteIpAddress); - response.Cookies.Append("sid", Convert.ToBase64String(buffer)); + response.Cookies.Append("sid", Convert.ToBase64String(buffer), new CookieOptions { Expires = DateTimeOffset.UtcNow + TimeSpan.FromDays(30) }); } ///