In an ASP.NET WebForms and MVC integrated app, the session time outs earlier on MVC views but not on WebForms

北战南征 提交于 2019-12-11 18:16:00

问题


I have integrated an ASP.NET MVC 4 app with a legacy ASP.NET 4 Webforms app. The webforms app used SQL Membership Provider to implement the security features with Forms authentication mode , so I've kept that security in the newly integrated app as well. I am using [authorize] attribute on some MVC action methods to protect some MVC views. This all works fine except that the MVC pages (Views) timeout earlier than the timeouts set for forms authentication and the sessionState as shown below in the web.config file

<authentication mode="Forms">
  <forms loginUrl="~/Account/Login.aspx" timeout="2880" />
</authentication>

<sessionState mode="InProc" customProvider="DefaultSessionProvider" timeout="600">

As you can see that the timeouts are set for several hours. Yet the MVC views timeout after about 30 minutes whereas webforms pages don't timeout in the same app. Why it's happening and how can it be resolved?

来源:https://stackoverflow.com/questions/22073534/in-an-asp-net-webforms-and-mvc-integrated-app-the-session-time-outs-earlier-on

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!