如果应用程序池标识设置为 'Custom account',但在设置为 'ApplicationPoolIdentity' 时,应用程序池回收用户会话将丢失

On app pool recycle user sessions are lost if application pool identity is set to 'Custom account' but not when it is set to 'ApplicationPoolIdentity'

在 IIS 8.5 上,我们有一个 Web 应用程序 运行 应用程序池的标识设置为 ApplicationPoolIdentity

当我们切换到 Custom account 而不是 ApplicationPoolIdentity 时,Web 应用程序的用户会话会随机丢失,并且在应用程序池回收时也会丢失.

但是 ApplicationPoolIdentity 一切正常。

出于各种原因,我们需要将应用程序池的身份设置为自定义帐户

知道使用具有 IIS_IUSRS 权限的 windows 用户帐户的自定义帐户有什么问题吗?

找到问题了!现在,当我们回收应用程序池时,会保留用户会话。 'Custom account' 与 ApplicationPoolIdentity 的行为相同。

当我们使用自定义帐户而不是 ApplicationPoolIdentity 时,必须将 IIS 应用程序池中的 Load User Profile 属性 设置为 True(这是默认值IIS 8).

"Load User Profile 设置仅适用于用户帐户。 NETWORK SERVICE 和 ApplicationPoolIdentity 等服务帐户有特殊处理。”详细信息: