title: SessionManager and Session is null randomly
body: <p>I have been faced with this problem for months and I have read almost all I can about this and implemented most solutions but still nothing has changed. I don't know where I am making my mistake.</p>
  
  <p>I am using a custom <code>SessionManager</code> class to get/set values into <code>Session</code> easily in my ASP.net CMS websites' admin panels. When the user logins I store user data to the <code>Session</code> then read in Admin.master page to check if the user is logged in. On different servers and also on localhost, the <code>SessionManager.CurrentUser</code> value is null at random times, sometimes 2 minutes sometimes 20 minutes after login, whether the page is idle or not. All my websites have the same problem.</p>
  
  <p>My SessionManager.cs is </p>
  
  <pre><code>public class SessionManager
  {
      public SessionManager() { }
  
      public static User CurrentUser
      {
          get { return (User)HttpContext.Current.Session["crntUsr"]; }
          set { HttpContext.Current.Session["crntUsr"] = value; }
      }
  
      public static string CurrentAdminLanguage
      {
          get
          {
              if (HttpContext.Current.Session["crntLang"] == null) HttpContext.Current.Session["crntLang"] = SiteSettings.DefaultLanguage;
              return HttpContext.Current.Session["crntLang"].ToString();
          }
          set
          {
              HttpContext.Current.Session["crntLang"] = value;
          }
      }
  }
  </code></pre>
  
  <p>Note: User class is [Serializable]</p>
  
  <p>In Admin.master Page_Load</p>
  
  <pre><code>if (SessionManager.CurrentUser == null) Response.Redirect("../login");
  </code></pre>
  
  <p>In web.config</p>
  
  <pre><code>    &lt;system.web&gt;
           &lt;sessionState mode="InProc" customProvider="DefaultSessionProvider" cookieless="UseCookies" regenerateExpiredSessionId="true" timeout="60"/&gt;
           &lt;machineKey validationKey="CC0...F80" decryptionKey="8BF...1B5" validation="SHA1" decryption="AES"/&gt;
           &lt;authentication mode="Forms"&gt;
               &lt;forms loginUrl="~/login" timeout="60" slidingExpiration="true" cookieless="UseCookies" /&gt;
           &lt;/authentication&gt;
  
      &lt;system.webServer&gt;
          &lt;modules&gt;
              &lt;remove name="Session"/&gt;
              &lt;add name="Session" type="System.Web.SessionState.SessionStateModule"/&gt;
          &lt;/modules&gt;
  </code></pre>
  
  <p>I really have no more ideas to solve this issue. Please help :(</p>