1

I have an Asp.Net web forms application that uses the session state stored in SQL Server.

I have created this session state database following this article - execute the script InstallSqlState.sql located in system drive\Windows\Microsoft.NET\Framework\version\:

https://support.microsoft.com/en-us/help/317604/how-to-configure-sql-server-to-store-asp-net-session-state

Is it necessary for another application create separate database for storing session state?

What is best practice - keep session state in one database or use separate databases?

If I only use one session state database per both applications - are there some issues - maybe security issue etc?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Jenan
  • 3,408
  • 13
  • 62
  • 105

1 Answers1

3

Ideally you should not share the session across the applications, as the default scripts provided are only meant for one application. If you want to support multiple applications you need to change the provided code which is not correct.

If you share, you may end up with performance bottlenecks and locking issues.

To make it happen check this SO Post

PSK
  • 17,547
  • 5
  • 32
  • 43
  • Or use separate databases for every application? For instance - SessionStateApp1 - SessionStateApp2? – Jenan Mar 22 '18 at 08:25
  • It's better to separate the database, read the post https://sqlperformance.com/2013/01/t-sql-queries/optimize-aspstate – PSK Mar 22 '18 at 08:30