Tsing still.......
This commit is contained in:
+12
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user