Avatar of Arikkan
Arikkan
Flag for United States of America asked on

Session Timeout issue for Web application hosted on IIS

Hi,

I am working on a Web application which has session Timeout set in the file Global.asax as below:

Private Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
    Session.Timeout = 30
End Sub


When I change the timeout and test on my local machine, it works perfectly to the minute (Lower or higher value).

Now we deploy on server (IIS / Windows Server 2008 R2 Standard) and the timeout does not work. It gets capped at 20 min. I can reduce the timeout, but cannot increase it more than 20 min. Something else is interfering with the timeout. I am not sure what it might be on the server.

Any ideas what can be causing that?
.NET ProgrammingWeb ApplicationsMicrosoft IIS Web Server

Avatar of undefined
Last Comment
Arikkan

8/22/2022 - Mon
Dan McFadden

You're getting overridden by defaults settings in the ASP.NET Session State configuration of your website.

1. On the server, go into IIS Manager
2. Select the website with the issue
3. In the Feature area, under ASP.NET, double click Session State
4. In the Coolie Settings, update the Time-out (in minutes) setting to reflect your desired timeout.

You may need to stop/start the site for the configuration to get picked up.

Dan
Arikkan

ASKER
I changed it, but this did not work.

I am trying to change other settings in IIS to see if they work:


1. Configure Idle Time-out Settings for an Application Pool
https://technet.microsoft.com/en-us/library/Cc771956(v=WS.10).aspx


2. Add this to Web Config
http://stackoverflow.com/questions/2414441/how-to-increase-request-timeout-in-iis7-0

<system.web>
    <httpRuntime executionTimeout="1800" />
</system.web>


3. Add this to Web Config
<system.web>
    <sessionState timeout="40" />
</system.web>


Do you have any other suggestions?
ASKER CERTIFIED SOLUTION
Arikkan

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Arikkan

ASKER
My proposed solution worked.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy