I have the line:
<sessionState mode="SQLServer" sqlConnectionString="Data Source=localhost;User Id=sa;Password=test;" timeout="1" />
Which stores the session in a sql state server. However it does not timeout properly after one minute.
When I change the line to use InProc mode:
<sessionState mode="InProc" sqlConnectionString="Data Source=localhost;User Id=sa;Password=test;" timeout="1" />
It does timeout after one minute.
Any ideas why this is happening? How can I get it to timeout when using SqlServer?
If you’re using SQL Server Express, it’s because there is no SQL Server Agent to execute the DeleteExpiredSessions procedure.
Here is a possible workaround to the problem: