Session Time out in IIS 7

后端 未结 6 1405
自闭症患者
自闭症患者 2020-12-09 23:52

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

相关标签:
6条回答
  • 2020-12-10 00:19

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

    enter image description here

    OR

    Advanced settings

    0 讨论(0)
  • 2020-12-10 00:20

    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.

    0 讨论(0)
  • 2020-12-10 00:32

    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

    0 讨论(0)
  • 2020-12-10 00:38

    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.

    0 讨论(0)
  • 2020-12-10 00:39

    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.

    0 讨论(0)
  • 2020-12-10 00:39

    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.

    0 讨论(0)
提交回复
热议问题