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

后端 未结 8 2317
情歌与酒
情歌与酒 2020-11-27 13:38

It\'s not explicitly written somewhere but I felt so after reading few blogs on ASP.NET MVC. Just got curious and thought of asking it here.

UPDATE:

8条回答
  •  攒了一身酷
    2020-11-27 14:31

    It really depends on how much data you are maintaining in the session state. As a rule of thumb, I try to just use it for a few strings here and there and not much more. For a large form, for example, I might store a reference ID to that session, then store all the needed data in SQL temp tables based on that ID. It is kind of a pain, but the session state is not meant to be used to store loads of information.

提交回复
热议问题