0
votes

On IIS 8.5 we have an web application running with application pool's identity set to ApplicationPoolIdentity.

When we switch to Custom account instead of the ApplicationPoolIdentity then web application's user session is lost at random and also on app pool recycles.

But everything is ok with the ApplicationPoolIdentity.

We need to set the application pool's identity to Custom account for various reasons.

Any idea what is the issue with Custom account which is using a windows user account that has IIS_IUSRS permission.

1
which session mode you are using in iis? if you are using InProc mode for SessionState persistence, then any data that you've added to the session's Dictionary in your server code will be lost during an App Pool recycle - after the recycle.So, I suggest you could use Session SQLServer model or StateServer mode. you could refer this link for more detail about iis session state.Jalpa Panchal
@JanviPanchal IIS_IUSRS permission. How is that related to pool recycle and user session issues? Session state mode is InProc as I did not mention anything in the web.config. It is not necessary that session data will be lost if app pool recycles. Also shifting the state server is not an option for now.Rahatur
which session mode you are using in iis?Jalpa Panchal

1 Answers

0
votes

Found the problem! Now user session is retained when we recycle the app pool. 'Custom account' Behaving the same as ApplicationPoolIdentity.

When we are Custom account instead of the ApplicationPoolIdentity, had to set Load User Profile property in IIS app pool to True (which is the default value for IIS 8).

"Load User Profile setting only applies to user accounts. Service Accounts like NETWORK SERVICE and ApplicationPoolIdentity have special handling." Detail: https://stackoverflow.com/a/17149834/218408