ASP.Net Custom Session State Management

Saber Shebly picture Saber Shebly · Mar 4, 2011 · Viewed 9.6k times · Source

Is it possible to build a fully customized Session State Mode instead of using Inproc or SQLServer?

Answer

Darin Dimitrov picture Darin Dimitrov · Mar 4, 2011

Yes, absolutely, you could write a custom session state store provider by implementing SessionStateStoreProviderBase class and then set the session state mode to this custom implementation in web.config:

<sessionState 
    mode="Custom"
    customProvider="SomeCustomProviderName">
    <providers>
        <add name="SomeCustomProviderName"
             type="YourNamespace.CustomSessionStateStore"
             connectionStringName="SomeConnectionString" />
    </providers>
</sessionState>