Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to create sticky session in asp.net

How to Create sticky Session, and what kind of session is usefull for sticky Session and load balancing please answer. Thanks

<sessionState mode="SQLServer" stateConnectionString="tcpip=<IPADDRESSOFTHESERVER>:42424"
cookieless="false" timeout="100"/>


  
<sessionState mode="StateServer"
  stateConnectionString="tcpip=SampleStateServer:42424"
  cookieless="false"
  timeout="20"/>



<sessionState mode="InProc" cookieless="false" timeout="100"/>
like image 312
Adeel Khan Avatar asked Sep 03 '25 09:09

Adeel Khan


1 Answers

Session-State offers 3 modes for load balancing - StateServer, SQLServer and Custom.

If your application do not use Cache, you can use either one of three. I personally like SQLServer over StateServer, but SQLServer is not cheap.

However, if you use Cache, you want to use Custom mode to store Session-State in a cache. For example, Redis Cache.

like image 126
Win Avatar answered Sep 05 '25 01:09

Win