是否可以在不丢失用户会话的情况下回收 IIS 应用程序池? [英] Is it possible to recycle IIS application pools without losing user sessions?

查看:22
本文介绍了是否可以在不丢失用户会话的情况下回收 IIS 应用程序池?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们目前正在部署代码以保持目前的正常运行,但不利的一面是破坏了用户会话数据.

We're currently deploying code to live pretty reguarly at the moment, but the down side is destroying user session data.

有没有办法在不丢失会话数据的情况下回收 IIS,或者在 SQL Server 中保持会话状态或类似的唯一方法?

Is there a way of being able to recycle IIS without loosing session data, or is persisiting session state in SQL server or alike the only way?

推荐答案

内存中的会话状态存储在 IIS 工作进程的内存中.当您重新启动应用程序池时,您实际上是在停止和重新启动工作进程,因此工作进程保持的任何状态,包括所有会话对象,都将丢失.因此,是的,您需要将会话数据存储在 IIS 工作进程之外,例如在 SQL 中,以免破坏"用户的会话数据.

In-memory session state is stored in the memory of the IIS worker process. When you restart the application pool you are effectively stopping and restarting the worker process, so whatever state is held by the worker process, including all session objects, is lost. So, yes, you need store session data outside the IIS worker process, such as in SQL, in order to not "destroy" users' session data.

这篇关于是否可以在不丢失用户会话的情况下回收 IIS 应用程序池?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆