Using ASP.NET State Server Session
Using State Server, session is serialized and stored in memory in a separate process (aspnet_state.exe). State Server can run on another machine.
Main advantages of using State Server session over the default In-proc session:
- Session is persistent, you dont need to afraid your session data is lost during application restarts
- Avoid Session Timeout due to memory shortage on server (IIS Setting)
- Performace overhead compared to In-Proc session (when storing data of basic types like string, integer, etc.)
- Object needs to be serialized. Serialization/deserialization can affect performance if you’re storing lots of objects.
Steps to implement State Server session in your web application:
Step 1: Start ASP.NET State Servcie
- Go to Control Panel > Administrative Tools > Services
- Select ASP.NET State Service.
- Right Click on ASP.NET State Service and choose start from popup menu.
Step 2: Change Session Mode in Web.Config File
Step 3: Make All Object Serializable