Honor forwarded proto and scope cookie to base path to prevent new player cookies
This commit is contained in:
@@ -10,13 +10,17 @@ public static class PlayerIdentityExtensions
|
||||
{
|
||||
app.Use(async (ctx, next) =>
|
||||
{
|
||||
var pathBase = ctx.Request.PathBase.HasValue ? ctx.Request.PathBase.Value : "/";
|
||||
var isHttps = string.Equals(ctx.Request.Scheme, "https", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
var cookieOptions = new CookieOptions
|
||||
{
|
||||
HttpOnly = true,
|
||||
SameSite = SameSiteMode.Strict,
|
||||
Secure = !app.ApplicationServices.GetRequiredService<IWebHostEnvironment>().IsDevelopment(),
|
||||
Secure = isHttps,
|
||||
IsEssential = true,
|
||||
Expires = DateTimeOffset.UtcNow.AddYears(1)
|
||||
Expires = DateTimeOffset.UtcNow.AddYears(1),
|
||||
Path = pathBase
|
||||
};
|
||||
|
||||
Guid playerId;
|
||||
|
||||
Reference in New Issue
Block a user