on-internet
← Community

How to use session variables in ASP.NET Core 3.1 MVC using C#

Stack Overflow ·

I'm having trouble with session objects. To set and get inside the same controller will work fine, my trouble is to use the info saved in the session in another controller, it doesn't work for me, every time I get a null value. I used to code PHP, I just needed to start session and get the values. No idea how to do it in ASP.NET Core 3.1 MVC. using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using partner2.Data; using partner2.Helpers; using partner2.Models; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace partner2.Contro

Comments

Sign in or sign up to comment and upvote.

No comments yet.