Sql-server – Store session (asp.net) in SQL Server

asp.netsql server

If we want to store sessions in SQL Server, which table stores the sessions?

To implement ASP.NET SQL Server mode session state management, you must modify the element of your application's Web.config file as follows:

1.Set the mode attribute of the element to SQLServer to indicate that session state is stored in SQL Server.

2.Set the sqlConnectionString attribute to specify the connection string for SQL Server. For example:

  sqlConnectionString="data source=MySQLServer;user id=<username>;password=<strongpassword>"

Note The user, , must have permissions to perform this operation on the database.

The modified element should appear as follows:

        <sessionState 
        mode="SQLServer"
        sqlConnectionString="data source=127.0.0.1;user id=<username>;password=<strongpassword>"
        cookieless="false" 
        timeout="20" 
/>

The question is that is there a particular table storing the sessions?

Store session in SQL Server is a vague concept.

Thanks.

Best Answer

You're supposed to run the ASP.Net SQL Server Registration Tool first. The tool will create the appropriate session state tables.