Question

Can it be done or the only way is to configure it on IIS?

Was it helpful?

Solution

You edit generally the Global.asax file's Session_Start method and set Session.TimeOut to whatever you want. You can do this anywhere else in your code too.

OTHER TIPS

you can, but it will not override the IIS settings (by default 20 minutos) if you are in a Shared Hosted environment.

what I do is apply the use of SQL Sessions, it will turn the web application a little more slow, but you have total control of the sessions and if you update something to the application and the Compiler needs to re-compile the resources/classes again, the user will not be logged out.

Sessions will be kept in a special table of the SQL database.

If your in a hosted environment and your not allowed to override IIS default session timeout (as others have mentioned in the comments), you can trick IIS into keeping the session alive for longer by using an iframe that refreshes the session over and over (kind of like a keep alive ping) for whatever interval of time you need. I had this situation and used this approach

ASP.NET Push Redirect on Session Timeout

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top