




















添加Session Nuget包

更新Startup.cs文件
在ConfigureServices方法中添加如下代码
services.AddSession(options =>
{
// Set a short timeout for easy testing.
options.IdleTimeout = TimeSpan.FromSeconds(3);
options.CookieHttpOnly = true;
});
在Configure方法中添加如下代码
app.UseSession();

使用Session

此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。