简体   繁体   中英

Timeout issues with LMS website

The site is built using ASP.NET, C#.NET, JavaScript, Angular JS, HTML5 and CSS3.

I have a couple of issues, then I am happy enough.

Main issue is the website keep timing out, after five minutes of inactivity. eg logging off.

I really need the website to stay running so learners can simply go back four hours later?

Is this possible?

Here is the code, which I think controls the website timeout.

<system.web>
<customErrors mode="On" defaultRedirect="~/Home/Error"></customErrors>
<!--<customErrors mode="Off"></customErrors>-->
<authentication mode="Forms">      
</authentication>
<!--<authorization>
  <allow  users="?" />
</authorization>-->
<sessionState timeout="10080"  />
<compilation debug="true" targetFramework="4.5.2" />
<httpRuntime targetFramework="4.5.2" maxRequestLength="1048576" executionTimeout="3600" />
<!--<httpRuntime maxRequestLength="1048576" executionTimeout="3600" />-->
<httpModules>

Keep your session timeout relatively short. A really long timeout can lead to memory and resource issues. Instead, to prevent unexpected logouts or session timeouts, add some javascript into your page template that sends an ajax request to your server every so often. That will reset the session timeout.

In this way, the user will stay logged in as long as they leave a page open, but your server will still be able to reclaim the session resources soon after they leave the site.

It's sometimes worthwhile to even have a special asp.net page where you can target these ajax requests, so that you don't waste resources building unnecessary content. If you want, you can have this page provide a json response and it becomes useful place to put updates back to user's browser from the server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM