We have an ASP.NET MVC webapp and not using anything like ASP.NET Identity. We'd like to store session (simple User ID string) in SQL Server for the sake of reliability over InProc (AND we also want to extend session timeout with SQL Server also).
We are using HttpContext.Session.Get
/ Set
to read/write session values. But all the tables inside ASPState
are always empty.
This is our web.config
:
<system.web>
<identity impersonate="false" />
<authentication mode="Windows" />
<sessionState mode="SQLServer" timeout="1440"
sqlConnectionString="Server=localhost;Integrated Security=true;Application Name=xxxx;" cookieless="false" />
</system.web>
Our ASP.NET MVC controller:
HttpContext.Session.SetString("userid", "abcd");