title: HttpContext.Current.Session throwing Object reference error in server not in local
body: <p>In a Authorizaiton class I am assigning user object to session </p>
  
  <pre><code> HttpContext.Current.Session[Constants.SessionActiveUserInfo] = userInfo;
  </code></pre>
  
  <p>It is working fine in local but in server it is throwing </p>
  
  <blockquote>
    <p>"Object reference not set to an instance of an object."</p>
  </blockquote>
  
  <p>when I hit url with controller/actionmethod name it is throwing HTTP Error 500 ("Object reference not set to an instance of an object.") because of session.
  Then if I hit the url again, it is working fine.</p>
  
  <p>Why it is behaving like this? Any help?</p>