From b77c79e89d9aec0055f6c1851040cc4425a20563 Mon Sep 17 00:00:00 2001 From: Brennan Date: Fri, 20 Sep 2024 16:43:03 -0700 Subject: [PATCH] Add partitioned to cookie for SignalR browser testing (#57997) * Add partitioned to cookie for SignalR browser testing Looks like Chromium (not chrome) headless now requires 'partitioned' on the cookie when using `Secure` and `Same-Site=None` * Apply suggestions from code review Co-authored-by: Andrew Casey --------- Co-authored-by: Andrew Casey --- src/SignalR/clients/ts/FunctionalTests/Startup.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/SignalR/clients/ts/FunctionalTests/Startup.cs b/src/SignalR/clients/ts/FunctionalTests/Startup.cs index 45d3f8546a71..dd3ee9378458 100644 --- a/src/SignalR/clients/ts/FunctionalTests/Startup.cs +++ b/src/SignalR/clients/ts/FunctionalTests/Startup.cs @@ -184,9 +184,11 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILogger< { cookieOptions.SameSite = Microsoft.AspNetCore.Http.SameSiteMode.None; cookieOptions.Secure = true; + cookieOptions.Extensions.Add("partitioned"); // Required by Chromium expiredCookieOptions.SameSite = Microsoft.AspNetCore.Http.SameSiteMode.None; expiredCookieOptions.Secure = true; + expiredCookieOptions.Extensions.Add("partitioned"); // Required by Chromium } context.Response.Cookies.Append("testCookie", "testValue", cookieOptions); context.Response.Cookies.Append("testCookie2", "testValue2", cookieOptions);