Skip to content

Commit

Permalink
Add partitioned to cookie for SignalR browser testing (#57997)
Browse files Browse the repository at this point in the history
* 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 <amcasey@users.noreply.github.com>

---------

Co-authored-by: Andrew Casey <amcasey@users.noreply.github.com>
  • Loading branch information
BrennanConroy and amcasey authored Sep 20, 2024
1 parent 92376ce commit b77c79e
Showing 1 changed file with 2 additions and 0 deletions.
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

0 comments on commit b77c79e

Please sign in to comment.