Here Mudassar Ahmed Khan has explained, how to enable Session in ASP.Net Core.
By default, Session State is disabled in ASP.Net Core applications i.e. ASP.Net Core MVC and ASP.Net Core Razor Pages.
This article will cover the steps to enable Session Sate in ASP.Net Core applications.