Why Session is a disaster in ASP.NET MVC application?

后端 未结 2 1480
天命终不由人
天命终不由人 2020-12-04 18:04

Why is it being said We should not use Session variables in ASP.NET MVC applications ? I came across this answer which says so. In that case how will i mai

2条回答
  •  旧巷少年郎
    2020-12-04 18:51

    One of the fundamental principles of frameworks like ASP.NET MVC is that they are stateless, just like the Web is. ASP.NET Web Forms is an attempt to mimic a stateful paradigm over a stateless enviroment. It is a lie, in other words.

    Using Session variable in an ASP.NET MVC application is a bit like tying a horn to a horse's head, and calling it a Unicorn.

提交回复
热议问题