3

I know this is a common problem, but I've tried every suggestion I've found and none of them seems to work for me.

I have a Windows Dedicated Server with a hosting provider. I have a Web site developed in asp.net. I want to increase the session timeout (not the application timeout), meaning, I want sessions to last longer.

I've tried editing the web.config file by adding this line inside

<sessionState timeout="60"></sessionState>

And I've tried changing this value in iis by following this article:

http://technet.microsoft.com/en-us/library/cc725820(v=ws.10).aspx

The authentication section in my web.config file is as follows:

<authentication mode="Windows"/>

None of these options seems to work. The session values are null after 5 mins (or less). I've logged in, waited almost 6 minutes, and when tried to access another page, the Session value was null.

Any help would be greatly appreciated.

Adam
  • 16,089
  • 6
  • 66
  • 109
Gonzalo
  • 982
  • 6
  • 23
  • 39

2 Answers2

0

First Check the Windows Event Log to ensure that the Worker Process is not being forced to recycle.(Event Viewer->Windows Log->System)

There may be something in your code that causes the Worker Process to force itself to recycle . enter image description here

You can to make these changes in the IIS=>Pool Application=>Advance Setting For Change Session Time Out

enter image description here enter image description here enter image description here

ashkufaraz
  • 5,179
  • 6
  • 51
  • 82
0

try this in the global asax file

void Session_Start(object sender, EventArgs e) 
    {
        // Code that runs when a new session is started
        Session.Timeout = Your Number here;
    }
Samir Adel
  • 2,691
  • 2
  • 15
  • 16
  • Hi Samir.. Thanks for the answer, but it didn't work. It seems to work when testing in localhost, but once uploaded into my server, the sessions last 5 mins. I've uploaded global.asax into root folder, maybe this isn't the right place? – Gonzalo Aug 05 '11 at 03:12