Session getting expired on file upload or modification in web.config in

154 Points
67 Posts


I am using session to maintain session state. Application hosted on IIS share hosting plan. When any .dll file or web.config modified on the server, session getting expired. Also some session expired a very short time. What is the reason for this.

Please help.

Views: 9285
Total Answered: 1
Total Marked As Answer: 0
Posted On: 23-Dec-2015 09:16

Share:   fb twitter linkedin
NiceOne Team
414 Points
67 Posts

Hi Sam,

The main reason of session getting expired is that Application Pool is restarting. Since Session State Mode by default of a web application is InProc.

You can solve this problem using following methods:

  • Use Other Session State Mode like StateServer or SqlServer.
  • Use cookies for Session State management.

For Session State Mode Use following section in web.config

<sessionState mode="InProc"
Posted On: 26-Dec-2015 00:34
 Log In to Chat