Tsing still.......

This commit is contained in:
dingo
2026-01-30 21:54:49 -05:00
parent bf78527821
commit 975cf2b03d
+12
View File
@@ -49,6 +49,8 @@ builder.Services.AddSession(options =>
options.Cookie.Path = "/admin";
options.Cookie.SecurePolicy = CookieSecurePolicy.Always;
options.Cookie.SameSite = SameSiteMode.Lax;
// Avoid double-encoding/chunking issues that can break DP unprotect.
options.CookieManager = new ChunkingCookieManager { ChunkSize = null };
});
builder.Services.AddAntiforgery(o =>
{
@@ -150,6 +152,16 @@ fwdOpts.KnownProxies.Clear();
app.UseForwardedHeaders(fwdOpts);
app.UseRouting();
app.Use(async (ctx, next) =>
{
var raw = ctx.Request.Headers.Cookie.ToString();
var session = ctx.Request.Cookies[".Divers.Admin.Session"];
if (!string.IsNullOrEmpty(raw))
app.Logger.LogInformation("RAW Cookie Header: {Raw}", raw);
app.Logger.LogInformation("Decoded Session Cookie: {Session}", session ?? "<null>");
await next();
});
// ---- Session middleware (must be before routing) ----
app.UseSession();