This problem usually happens when you move your SharePoint farm to a different database server using SQL Aliases. When you create the Session State Database in SharePoint, it creates a SQL Agent job called <DB Name>_Job_DeleteExpiredSessions. This job runs every minute to clean out the expired sessions from the database. Without it, your database will fill up very quickly and eventually consume all the disk space on your database server.


You can either re-create the Session State Database using SharePoint Management Shell or you can script to job and re-create it on your new database server.

Method #1

Run SharePoint Management Studio


Enable-SPSessionStateService -DatabaseName <String> [-DatabaseServer <String>]


You should see your newly created Session State Service Application on the new database server.

Method #2

Login to your old database server and run SQL Management Studio

Expand SQL Server Agent -> Jobs

Locate the job <Session State Database Name>_Job_DeleteExpiredSessions

Right click -> Script Job as -> Create To -> Clipboard

Login to your new database server and run SQL Management Studio

Click on New Query -> Paste

You should see something like:

SE [msdb]
/****** Object:  Job [SessionStateServiceDB_Job_DeleteExpiredSessions]    Script Date: 01/08/2013 14:56:17 ******/
SELECT @ReturnCode = 0

Click on Execute, this will create the job under the SQL Server Agent.

Right click on SQL Server Agent -> Refresh

Expand Jobs and you should see that the job has copied to your new database server.

Right click on it and check the properties / schedule, etc. All settings should be exactly the same as on the old database server.