Session Time out in IIS 7

I like to host asp.net web application in IIS 7.0 (windows server 2008).

I configured session state as sessionstate mode=”inproc” timeout = 120.
Even the session expires within 15 seconds. What could be the problem?.

Thanks

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

You can check your connection timeout in these 2 areas.
enter image description here

enter image description here

OR

Advanced settings

Method 2

Check the Windows Event Log to ensure that the Worker Process is not being forced to recyle.

There may be something in your code that causes the Worker Process to force itself to recyle in which case when the session is stored inProc it will loose all session values it’s holding.

Method 3

sounds like the session timeout is set incorrectly in the web.config you could try something like:

<system.web>
    <sessionState timeout="2" />

to set the timeout to 2 minutes

http://msdn.microsoft.com/en-us/library/h6bb9cz9(vs.71).aspx

Method 4

Mmerrell wrote this and is key to find the origin of problem:

Check the Windows Event Log to ensure that the Worker Process is not
being forced to recyle.

There may be something in your code that causes the Worker Process to
force itself to recyle in which case when the session is stored inProc
it will loose all session values it’s holding.

Look at the Event viewer on “Windows logs/system”, you are looking for a “WAS” Source event that contains a description like:
“A worker process with process id of ‘2980’ serving application pool ‘SIAC’ was shutdown due to inactivity. Application Pool timeout configuration was set to 20 minutes. A new worker process will be started when needed.” this is the symptom you are looking for.

Event viewer with the WAS event

Hope this helps.

Method 5

Had nearly same problem with HTTP handler written in C# using SessionState. Seems the property IsReusable should be false otherwise I was running in the problem of session loose.

Thanks Mmerrell for his Response, which brought me on right track.

Method 6

There also another thing to check – App Pool Advanced settings – Virtual memory limit. See if it is explicitly set – as it may recycle automatically once exceeds the set limit. Especially if you are seeing the error in your event log like :

A worker process with process id of ‘****’ serving application pool ‘your-app-pool-name’ has requested a recycle because it reached its virtual memory limit.

Method 7

You need to make these changes in the IIS=>Pool Application=>Advance Setting…

Session Time out in IIS 7
Session Time out in IIS 7
Session Time out in IIS 7


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x