I got the vibe using session variable is sort of looked down upon in ASP.NET MVC.
Once a user logs in, I would like to retain the user’s userId so that I do not have to query it all the time etc.
What is the most efficient way to do that in ASP.NET MVC?
I have seen similar questions pop up once in a while and I can’t figure out where this “vibe” is coming from. This is what Session is specifically designed for – for storing session-related information. There’s absolutely nothing wrong with using Session to store a user id or similar information.