Regarding Web Farms RRS feed

  • Question

  • User-2061735273 posted

    We have hosted MVC4 web project into Web farm environment. But session value is becoming null or blank. I am using session state as "StateServer". In the both server am using same Machine Key and in service Asp State server is running also. Can anyone please help me out on this!!

    Thanks in advance!!

    Tuesday, September 12, 2017 5:11 AM

All replies

  • User-1838255255 posted

    Hi amogh1990,

    According to your description, as far as I know, you could refer to the following tutorials check how to share session in the web farms, please check:  

    Web farms in .NET and IIS part 5: Session state management:


    Session-State Modes


    ASP.NET Session DataSet, DataTable, and .NET Class Storage<!--EndNoIndex-->:


    Best Regards,

    Eric Du

    Wednesday, September 13, 2017 5:33 AM
  • User-2061735273 posted

    Hi Eric Du,

    Thanks for the valuable reply.

    I have had referred above links. and configured my web.config like that only. But still problem exists. Session is becoming null or blank after login. So its again landing to login page. The same project works in single server environment. But the problem in F5 Load Balancer or Web farm environment.

    I have made web.config settings like below.

    1) Machine key is same in both server web.config:

    <machineKey decryptionKey="6A6D9C0D7FE77BEBC269B03CA2AD46B5D47A41832655DFA4,IsolateApps"
    validationKey="5BD312E9194C4CA805774C7582311F9B7C3D4C73D28431AB93B4D5085E06EE377165D8F13005257BB2FC5D8B093A65C282787672873A4AB1E6AD236A888F31DC,IsolateApps" />

    2) Using session state as Stateserver like below:

    <sessionState mode="StateServer"

    3) AspState server is running in both the servers.

    4) Session objects are Serializable like below.

    public class CCredentialInfo : CClientCredentialInfo

    public string UserName { get; set; }
    public string ClientIdentification { get; set; }
    public string ClientKey { get; set; }

    public int ClientId { get; set; }

    After making above settings also problem exists. If any changes need to be done please let me know.

    But i suspect some configuration setting is missing in F5 Load Balancer. Can any one help me out to configure F5 Load Balancer settings to manage session details?.

    Thanks in advance!!

    Wednesday, September 13, 2017 9:26 AM
  • User-1838255255 posted

    Hi amogh1990,

    According to your description, please check the following tutorials about how to configure the session:

    Load Balancing And Session State Configuration:


    Load Balancing Configuration-Manage Session State:  


    Best Regards,

    Eric Du

    Saturday, September 16, 2017 8:58 AM