Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best practise to maintain authenticated user details in an ASP.NET Intranet MVC application

I am developing an Intranet.NET MVC application. I need to store user details like location, ID Number etc associated with each authenticated users.

In .NET Webform applications we used to save the logged in user's details in session. But what is the best practise in .NET MVC application ?

like image 707
James Stephan Avatar asked Aug 21 '13 06:08

James Stephan


1 Answers

You can still use session state in MVC, but it is not advisable. MVC as a pattern respects the statelessness of HTTP.

One alternative is to use Cache which only stores information in memory. Here is a SO question with more information: Why would ASP.NET MVC use session state?

Here is one more: Is it a good practice to avoid using Session State in ASP.NET MVC? If yes, why and how?

like image 178
Slavo Avatar answered Oct 13 '22 00:10

Slavo