Skip to content

Commit b5e9735

Browse files
committed
Ammending the methods DeleteCookie() and DeleteChunks() to ensure MaxAge of cookieOptions is set to null upon deletion
1 parent c58ed9b commit b5e9735

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Shared/ChunkingCookieManager/ChunkingCookieManager.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ public void DeleteCookie(HttpContext context, string key, CookieOptions options)
304304
responseCookies.Append(keyValuePairs, new CookieOptions(options)
305305
{
306306
Expires = DateTimeOffset.UnixEpoch,
307+
MaxAge = null, // Some browsers require this (https://github.com/dotnet/aspnetcore/issues/52159)
307308
});
308309
}
309310

@@ -331,6 +332,7 @@ private static void DeleteChunks(HttpContext context, IRequestCookieCollection r
331332
context.Response.Cookies.Append(keyValuePairs.ToArray(), new CookieOptions(options)
332333
{
333334
Expires = DateTimeOffset.UnixEpoch,
335+
MaxAge = null, // Some browsers require this (https://github.com/dotnet/aspnetcore/issues/52159)
334336
});
335337
}
336338
}

0 commit comments

Comments
 (0)