Select the product you need help with
- Internet Explorer
- Windows Phone
- More products
PRB: Session State Is Lost in Web Farm If You Use SqlServer or StateServer Session Mode
Article ID: 325056 - View products that this article applies to.
This article was previously published under Q325056
If you use SqlServer or StateServer session state mode, session state may be lost when you run an ASP.NET Web application in a load balanced Web farm environment.
To maintain session state across different Web servers in the Web farm, the application path of the Web site (for example, \LM\W3SVC\2) in the Microsoft Internet Information Services (IIS) metabase must be the same for all of the Web servers in the Web farm. The case also needs to be the same because the application path is case-sensitive.
On one Web server, the instance ID of the Web site where the ASP.NET application is hosted may be 2 (where the application path is \LM\W3SVC\2). On another Web server, the instance ID of the Web site may be 3 (where the application path is \LM\W3SVC\3). Therefore, the application paths between Web servers in the Web farm are different. For additional information about how to check the application path of the Web site, click the following article number to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/240225/ )Description of Adsutil and MetaEdit Used to Modify the Metabase
To work around this problem, synchronize the application path for the Web site in the IIS metabase for all Web servers in the Web farm. Make sure that the case is the same since the application path for the Web site is case-sensitive.
Note Microsoft recommends that you back up the IIS metabase before you change the metabase. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
302573To synchronize the application path of the Web site, use one of the following methods:
(http://support.microsoft.com/kb/302573/ )HOW TO: Back Up and Restore IIS
(http://support.microsoft.com/kb/312906/ )HOW TO: Create Keys by Using Visual C# .NET for Use in Forms Authentication
(http://support.microsoft.com/kb/313091/ )HOW TO: Create Keys by Using Visual Basic .NET for Use in Forms Authentication