My session becomes null. Here is how I assign it in a MVC project on login:
Session["connectionString"] = someString;
Session.Timeout = 70;
The, in a class library I use it:
HttpContext.Current.Session["connectionString"].ToString().
But, after some time I get null reference exception.
In the web.config I have:
<sessionState timeout="70"/>
Why do I get null reference exception.
If you are storing the session in memory (which is the default mode) everytime you recompile the application, the web server restarts the application domain and everything that you have stored in session is lost.