ASP.NET Session State Service

ASP.NET Session State Service

Fast2Host has enabled the ASP.NET Session State Service on all web servers. This ensures that session data is held by the service rather than the website worker process, preventing sessions from being lost when application pools are recycled.

Why This Matters

To maintain uptime and stability, application pools are recycled regularly — either after inactivity or once they reach a certain number of requests. Without the Session State Service, this recycling can cause session data to be lost.

By using the Session State Service, sessions remain intact even if the worker process is recycled.

Configuration in web.config

To take advantage of the Session State Service, edit your application’s web.config file and specify the following:

<sessionState mode="StateServer" />
    

This tells ASP.NET to store session data in the State Server rather than in-process.

2025 Update Notes

  • ASP.NET Framework: The sessionState setting remains valid and recommended.
  • ASP.NET Core: Session state is configured via middleware in Startup.cs or Program.cs, not in web.config.
  • Classic ASP v3: Renaming .asp files to .aspx is technically possible but considered legacy. Most customers now use ASP.NET Framework or Core.

Recycling Application Pools in Plesk

Sometimes you may need to manually recycle your application pool (for example, after configuration changes or troubleshooting). In Plesk, you can do this easily:

  1. Log in to your Plesk Control Panel.
  2. Navigate to Websites & Domains.
  3. Select the domain you want to manage.
  4. Click on IIS Application Pool (or ASP.NET Settings depending on your version).
  5. Click Recycle to restart the application pool.

Recycling clears the worker process and reloads your application, but with StateServer enabled, your sessions will remain intact.

Best Practices

  • Always configure sessionState in web.config for applications requiring persistent sessions.
  • Use StateServer mode for reliability across application pool recycles.
  • Consider SQLServer mode for distributed applications needing session persistence across multiple servers.
  • Recycle your app pool via Plesk when troubleshooting, rather than restarting the entire site.
✔ Tip: Using StateServer mode ensures your users stay logged in and session data is preserved, even during application pool recycling.
Was this article helpful?

mood_bad Dislike 0
mood Like 1
visibility Views: 9621

Need more information or have a question ?