How to set up session state in our ASP.NET Core and MVC Core Web applications?

InfoPath alternatives for form designing SharePoint

In this article, we will learn how to use our C# coding prowess to set up the session state in our ASP.NET Core and MVC Core Web applications.

Steps To Be Followed:
Step-1: New project:

Open Visual Studio and select File >> New Project.
The “New Project” window will pop up. Select .NET Core and select “ASP.NET Core Web Application“. Name our project and click “OK”.

A “New Project” window will pop up. Select Web Application and click “OK”, as shown below.

Also read: Steps to archive log files using NLog with ASP.NET Core

Step-2: Dependencies
Once our project is ready, open Solution Explorer, right-click “dependencies”, and click “Manage NuGet Packages.”.

Packages Required

We need to install the stable version of “Microsoft.AspNetCore.Session” from the NuGet Package Manager. Then only we can access the session state in ASP.NET Core. Click on the “Install” button.


Step-3: HomeControllers

Now, double click “HomeControllers.cs”. The following is an example of a session sharing in ASP.NET Core.


You May Also like the Following SharePoint Online Tutorials:

About Satyaprakash Samantaray

MVP Award Winner | Community Author & Contributor | Software Developer | Most Valuable Blogger(MVB)

View all posts by Satyaprakash Samantaray →

Leave a Reply