Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Prev Previous commit
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 <[email protected]>

---------

Co-authored-by: Andrew Casey <[email protected]>
  • Loading branch information
BrennanConroy and amcasey authored Sep 20, 2024
commit b77c79e89d9aec0055f6c1851040cc4425a20563
2 changes: 2 additions & 0 deletions src/SignalR/clients/ts/FunctionalTests/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading