Reputation: 23
i have asp.net application and we attend to place it on several servers with load balance server so i the problem that when the user log in to my application the load balance will forward him to a server on the farm and the when he make another request may the server send him to another server on our farm that have the application on it the problem is that the second server application will not verify that the user is log in in the first server application
so my question how to make the servers application identify that the user is already logged in
description on steps :
1- the user make request to our application 2- request will go the load balance server 3- load balance will forward it to server number 1 and the user will log in there and play with the application 4- another request from the user come to the load balance (may be he click on button or any thing like this ) 5-the load balance maybe will forward him to another server in the farm that have the application 6- the application will ask the user to log in again because he did not know that he logged in on another server
so now the problem how to make the second server know that this user is already logged in ????
Upvotes: 0
Views: 62
Reputation: 150108
You need to use a session management option that works across server bounds, such as StateServer or SqlServer
http://msdn.microsoft.com/en-us/library/vstudio/ms178586(v=vs.100).aspx
ASP.NET session state supports several different storage options for session data. Each option is identified by a value in the SessionStateMode enumeration. The following list describes the available session state modes:
StateServer mode, which stores session state in a separate process called the ASP.NET state service. This ensures that session state is preserved if the Web application is restarted and also makes session state available to multiple Web servers in a Web farm.
SQLServer mode stores session state in a SQL Server database. This ensures that session state is preserved if the Web application is restarted and also makes session state available to multiple Web servers in a Web farm.
For configuring your selected option in web.config, see
http://msdn.microsoft.com/en-us/library/vstudio/h6bb9cz9(v=vs.100).aspx
Upvotes: 1