Find the folder containing aspnet_regsql file, probably C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regsql.go to this folder from command prompt(CMD)
cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319
execute the command : ASPNET_REGSQL.EXE -S localhost -U sa -P MyPassword -ssadd -sstype p
replace ‘sa’ with database username and ‘MyPassword’ with database password.
Then go to IIS and select the website and go to Session State (in ASP.NET tab).
select SQL Server option and set the connection string. Provide the database username password of the ASPState database.
APPLY the settigns and browse your website.
if a new record is entered in ASPState database >ASPStateTempSessions table, your session works perfect!
- if you want to increase the session time out, go to the Application pool of your website in IIS > Advanced Settings and set the Idle-Timeout (Minutes) in Process Model tab to desired value. (default value is 20)