Timeout in ASP .NET MVC

3

I have problems with an ASP .NET MVC application. The application does a timeout at about 20 minutes and nothing is done on it.

I have these lines in web.config :

<authentication mode="Forms">
<forms loginUrl="~/Cuenta/Login" timeout="2880" />
</authentication>

I deactivated the session in this way, thinking that it would be that, but I still have the same problems.

<sessionState mode="Off" timeout="2880" />

Any idea what may be happening?

    
asked by David91 10.06.2016 в 13:13
source

2 answers

1

To define the timeout (in minutes) in MVC, it is done in the web.config:

<configuration>
  <system.web>
     <sessionState timeout="90"></sessionState>
  </system.web>
</configuration>

The default value is 20 (that's why right now at 20 minutes it goes out)

    
answered by 15.06.2016 / 15:10
source
0

I do not know if what you want is that you never do timeout or if you want to extend it more in time. I think the maximum time of session timout is 1 year, but I personally prefer not to unnecessarily lengthen the timeout time from the webconfig. Think that a long session of 1 year for example will keep all the info on the server side. If you have a lot of users it is unfeasible.

If what you want is that the session never expires you can do a hack in javascript to autologuee every X time.

Here the solution link

In this example, a heartbeat is performed every 5 minutes (configurable) I hope it works for you.

    
answered by 10.06.2016 в 13:28