Session Time out in IIS 7
Asked Answered
D

7

6

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

Dolorisdolorita answered 4/6, 2009 at 9:16 Comment(0)
I
7

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.

Indefinable answered 18/6, 2009 at 19:21 Comment(0)
V
10

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

enter image description here

OR

Advanced settings

Vale answered 13/4, 2012 at 7:40 Comment(1)
I think session timeout and connection timeout are two different things, but good to know.Syringomyelia
I
7

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.

Indefinable answered 18/6, 2009 at 19:21 Comment(0)
A
6

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

Azeria answered 4/6, 2009 at 10:33 Comment(0)
B
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.

Bellied answered 22/2, 2016 at 19:6 Comment(0)
R
1

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.

Represent answered 7/10, 2016 at 21:30 Comment(0)
T
0

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.

Tetradymite answered 3/2, 2018 at 5:45 Comment(0)
R
0

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

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

Replevin answered 28/4, 2021 at 5:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.