ASP.NET Core 中 Session

在Asp.net core中使用 session 需要自己添加配置

如下Startup.cs 文件中的两个方法中分别添加app.UseSession(); 和 services.AddSession();

 

 

 总结 :在.Net Framework中使用Session直接使用,而在.Net core中是要配置的,这是asp.net core组件化的明显特征。

posted @ 2019-10-27 11:17  学习的味道  阅读(89)  评论(0)    收藏  举报