How to configure SQL Server to manage ASP.NET sessions

前端 未结 2 1536
死守一世寂寞
死守一世寂寞 2020-12-20 05:30

I need to know how to configure the .config to manage Session state in SQL Server

2条回答
  •  [愿得一人]
    2020-12-20 05:58

    First you need to create a Session database. In order to do this:

    1. Look for the aspnet_regsql.exe
    2. Run this command aspnet_regsql.exe -S [ServerName] -E -ssadd -sstype p

    Where ServerName is your server name.

    This will create this database ASPState

    Now the configuration on the web.config

    Add this sentence over

    
    

    sqlCommandTimeout="7200" = 2hours and timeout="120" = 2hours

    If you need more options regarding aspnet_regsql you can take a look HERE

提交回复
热议问题