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 ?
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?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With