开发者

How to maintain user's session in ASP.NET MVC application?

开发者 https://www.devze.com 2022-12-18 15:53 出处:网络
I am working on migrating the existing ASP.NET application to MVC. Earlier we used to maintain the user sessions and can be accessed in whatever page we want.

I am working on migrating the existing ASP.NET application to MVC. Earlier we used to maintain the user sessions and can be accessed in whatever page we want.

Ex: Session["UserType"] = var_UserMastersBO.UserType.ToString();

We set this session Global.asax file.

In case if there are restricted pages based on the userType, we check this if condition in the page load.

Cal we implement the same in MVC?

Appreciate your responses. Thanks开发者_如何学运维


ASP.NET MVC is built on top of the ASP.NET so you can use every feature of ASP.NET like Session Membership Caching in MVC.

0

精彩评论

暂无评论...
验证码 换一张
取 消