Tuesday, October 25, 2011

Expired sessions are not being deleted from the ASP.NET Session State database

Reason:   One or more of the following might be causing this:

  • The SQL Server Agent service was stopped.
  • SQL Server Express is installed.
Note: We cannot run the SQL Server Agent service on an instance of SQL Server Express.

Resolution:   Start the SQL Server Agent service if it is stopped. Or else run the Timer Job State Service Delete Expired Sessions .
1.      Verify that the user account that is performing this procedure is a member of the Administrators group on the database server that is hosting the ASP.NET Session State database.
2.      In the Services snap-in, start the SQL Server Agent service.

To start the SQL Server Agent service
1.      On the Start menu, point to All Programs, point to Microsoft SQL Server 2008 R2, point to Configuration Tools, and then click SQL Server Configuration Manager.
2.      In SQL Server Configuration Manager, expand Services, and then click SQL Agent.
3.      In the results pane, right-click any instance, and then click Start.
A green arrow on the icon next to the SQL Server Agent and on the toolbar indicates that SQL Server Agent started successfully.
4.      ClickOK.

      1. On the Central Administration Web site, on the Quick Launch, click Monitoring.

 2. In the Timer Jobs section, click Review job definitions.
 3. Click State Service Delete Expired Sessions Job in the list of timer jobs.

4. Click Run Now.

Even after applying the above fixes the problem doesn’t get resolved go through the following steps:

1>    Check the Jobs under SQL Server Agent, and analyze the Job Activity Monitor report.

2>If the Session State Service job is not present ,create it using the following stored-procedure.



  1. Hi,

    I installed SP2010 with AutoSPInstaller. I don't have the timer job but I also don't have the sessionstate database that you shwo. I do have a sessionstate but with different tables and stored procs

  2. The "State Service Delete Expired Sessions"-Job is related to the "State Service", whereas the Health-Analyzer Issue "Expired sessions are not being deleted from the ASP.NET Session State database" relates to the "SharePoint Server ASP.NET Session State Service".
    The latter only needs to be configured if you want to show Reports inside an AccessServices-Site.