I am using NCache and it is working fine for storing sessions in a centralized store. Load balanced applications deployed on two different web servers should be able to use the same session object. I initially used the sample session app which came installed with NCache and then followed below steps which worked for me on the application end.
Session Sharing between same application deployed on two or more Web Servers.
Add NCache Session State Provider Assembly.
<assemblies>
<add assembly="Alachisoft.NCache.SessionStoreProvider, Version=4.8.0.0,
Culture=neutral, PublicKeyToken=CFF5926ED6A53769" />
</assemblies>
Add NCache Session State
<sessionState cookieless="false" regenerateExpiredSessionId="true" mode="Custom" customProvider="NCacheSessionProvider" timeout="1">
<providers>
<add name="NCacheSessionProvider"
type="Alachisoft.NCache.Web.SessionState.NSessionStoreProvider" exceptionsEnabled="true" nableSessionLocking="true" emptySessionWhenLocked="false" sessionLockingRetry="-1" sessionAppId="NCacheTestApp" useInProc="false" enableLogs="false" cacheName="SessionsCache" writeExceptionsToEventLog="false" AsyncSession="false" />
</providers>
Keep same machine key across Web Servers in Load balanced Webfarm.
<machineKey validationKey ="A01D6E0D1A5D2A22E0854CA612FE5C5EC4AECF24"
decryptionKey ="ACD8EBF87C4C8937" validation ="SHA1"/>
Deploy same application on all webservers which are load balanced.
Session Sharing between two different applications deployed on two or more Web Servers.
You can also share session data between two different applications if that’s what you are trying to achieve here.
- Keep all above steps same but ensure that two applications have same value for sessionAppId="NCacheTestApp" under SessionState tag.