How to configure the timeout of your ASP.NET web application? - iis-6

My previous experience with ASP.NET web application (regarding the timeout) is that it logouts the user every 30 minutes, regardless of what module is running, Is there a way that we can increase the application timeout to an hour or two?
Any help is highly appreciated, thanks in advance.

You can set the Sesion timeout in your web.config file.
<sessionState timeout="60" />
The value is defined in minutes.
I think you can set it programmatically as well from the HttpContext.Current.Session object.

If by application timeout you mean session timeout, then this can be done in the web.config. The timeout attribute on the sessionstate element takes an integer that indicates the number of minutes of inactivity before it times out the user's session.
<configuration>
<sessionstate timeout="20" />
.
.
.
</configuration>

In the web.config , set the value of timeout attribute to the value that you need.
<system.web>
<authentication mode="Forms">
<forms timeout="value in minutes"/>
</authentication>
</system.web>

There is a value in your web.config where you can set the timeout length.
<sessionState
timeout="60"
/>

Related

MVC 4 user get logged off quickly

I have an MVC 4 web application that log off some users quickly. The authentication cookie seem stetted up correctly (I also setted timeout to 720 (12 hours)). I also setted session timeout on config file and in IIS. The issue seem's to happen on IE most of the time user get logged off after like 10 minutes. And as usual I can't reproduce the issue on my end.
I am wondering if an ajax call could cause the issue? Or an http header? I searched a lot about that issue and found nothing outside of basic web.config settings.
There is my configs for session, membership and authentication
<sessionState timeout="720" mode="InProc"/>
<membership defaultProvider="SimpleMembershipProvider" >
<providers>
<clear/>
<add name="SimpleMembershipProvider" type="WebMatrix.WebData.SimpleMembershipProvider, WebMatrix.WebData"/>
</providers>
</membership>
<authentication mode="Forms">
<forms requireSSL="false" domain="dpars.com" loginUrl="~/Account/Login" protection="All" name="DPARSAuth" slidingExpiration="true" timeout="720"></forms>
</authentication>
You might be losing the sessions because you're using InProc Session-State mode, which stores sessions in memory. When you use this mode, the sessions will be lost anytime the web server process restarts, which can happen for a variety of reasons.
Try changing the sessionState mode to "SQLServer", or "StateServer" and see if that solves the problem.
More information on configuring these options can be found here: http://msdn.microsoft.com/en-us/library/ms178586(v=vs.100).aspx

Add session timeout in webConfig

i need add session timeOut in my web.config, but dont work.
I write in the tag of my web.config for set the timeout to be a 30 minutes, (its wrong?)
'<sessionState timeOut="30"/>'
i'm using VS 2008 and framework .net 3.5.
Can i help me ?
Are you using forms authentication? This would be proper for forms authentication.
<authentication mode="Forms">
<forms timeout="40"/>
</authentication>
Also, ensure you are matching proper case within your web.config.
'<sessionState timeOut="30"/>'
should be
<sessionState timeout="30"/>

Using ASP.NET MVC5 OWIN Authentication Hosted on GoDaddy expires after 5 minutes

I had some issues with authentication on MVC5, so to test it, I created a MVC5 project using the default template, didn't change anything.
If i run it with visual studio (debug/release), when I authenticate checking the RemindMe box, it keeps me logged in like forever. However, the same code, if I publish it, when I log in, after about 5 minutes I get logged out.
I'm using GoDaddy to host it. BTW, there is only one change i had to make. I had to set in the web.config to run in Full Trust.
<system.web>
<authentication mode="None" />
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<trust level="Full" />
</system.web>
I'm struggling to fix this. Does anyone have any clue on what could be causing that?
Try specifying an explicit <machineKey> in Web.config. For instructions on how to generate a <machineKey> element yourself, see http://support.microsoft.com/kb/2915218#AppendixA. (Always generate keys yourself; never copy and paste one that you got from an online generator.)

MVC4 Forms Authentication not timing out

I am using the MVC4 Simple Membership Provider. Initially the website logins were timing out prematurely and the user was requested to log back in. After searching, it seemed the solution was to add a "machineKey" element so that if the app pool was recycled, the login token would still be recognized. After adding that element to web.config, now my website is not timing out at all. Any ideas what might be going on?
<machineKey validationKey="D2BCD45AADBB49F1CB3537A1FEA07F93BDFA78A863849E3CC76CDFFAD183FE81BB709EACA8BF3E28BCCE0A5D58A147F4EA68B93B3C9768CA085867D613D14B5C,IsolateApps"
decryptionKey="DD27E5C7B983D2DDDE6371A08F4AEE9A2ECC754593FB4E33,IsolateApps" validation="SHA1" decryption="AES" />
<authentication mode="Forms">
<forms loginUrl="~/Account/Login" timeout="60" protection="All" slidingExpiration="true" />
</authentication>

Call returns with in 2 mins without completing the operation

We have developed a web application. In it we call a WCF web service method. The WCF function will take 5 mins to generate the output. In this case, our web application returned from WCF call within 2 mins without completing the operation.
Web application web.config:
receiveTimeout="00:10:00" sendTimeout="00:10:00"
How should I solve this problem?
There is another setting in your config file that controls the http request time out's.
the default value is 110 seconds
<configuration>
<system.web>
<httpRuntime executionTimeout="110"/>
</system.web>
</configuration>
Reference:
http://blogs.msdn.com/b/wenlong/archive/2008/03/10/why-changing-sendtimeout-does-not-help-for-hosted-wcf-services.aspx