ASP.net State Server losing session in load balanced environment

ASP.NET会话状态服务器负载平衡的环境中失去

问题 (Question)

I am aware that this is a commonly asked question but I have yet to find anything that answers my question. I am randomly losing session data in a load balanced environment. I have done the following:

  • Set all the servers to the same state server
  • Ensured that all the machineKeys in the web.config are the same
  • Ensured that all the machineKeys in the machine.config are the same
  • Ensured that all the paths to the web service files are the same (case sensitive)
  • Made sure that the services all have the same ID

The session simply will not persist over multiple web servers. The following is the web.config session information:

    <sessionState cookieless="UseCookies" mode="StateServer" stateConnectionString="tcpip=[ipAddress]:42424" stateNetworkTimeout="30" timeout="60" />

Any ideas? I am out of them. Thanks!

我知道这是一个常见的问题,但我还没有发现什么,回答我的问题。我随机丢失会话数据,在负载平衡的环境。我曾经做过如下:

  • 将所有的服务器相同的状态的服务器
  • 确保在Web.config中所有的machinekeys是相同的
  • 确保在machine.config所有machinekeys是相同的
  • 确保所有路径的Web服务文件是相同的(区分大小写)
  • 确保服务都有相同的ID

会议将不在多个Web服务器的坚持。以下是一些会话信息:

    <sessionState cookieless="UseCookies" mode="StateServer" stateConnectionString="tcpip=[ipAddress]:42424" stateNetworkTimeout="30" timeout="60" />

任何想法?我出来。谢谢!

最佳答案 (Best Answer)

I've been told it's not possible to persist session data in a multi-server environment unless you use a SQL Server instance to store it...I'm assuming you're familiar with it but here's a link for others who may not be:

http://support.microsoft.com/kb/317604

有人告诉我坚持会话数据在多服务器环境是不可能的除非你使用一个SQL Server实例存储……我假设你已经熟悉了这里的一个人不可能联系:

http://support.microsoft.com/kb/317604

本文翻译自StackoverFlow,英语好的童鞋可直接参考原文:http://stackoverflow.com/questions/16925970