title: session returns null object in asp.net
body: <p>I am developing asp.net web application in which i am using <code>Session</code> to store user related data.Though i am storing data in session object when i am trying to retrieve it gives me error :  </p>
  
  <p><code>Object reference not set to an instance of an object.</code></p>
  
  <p><strong>Setting session variable</strong> </p>
  
  <p>somewhere in code behind of aspx page (myfile.aspx.cs)</p>
  
  <pre><code>HttpContext.Current.Session["ProjectID"] = Request.QueryString["Pid"].ToString();
  </code></pre>
  
  <p><strong>Retrieving Session Variable</strong> </p>
  
  <p>Normal Business Logic C# Class (Someclass.cs) </p>
  
  <pre><code>sProjectID = HttpContext.Current.Session["ProjectID"].ToString();
  </code></pre>
  
  <p>It gives me error on above line. It looks weird to me. can anyone explain this ?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Call to class pass through generic handler (.ashx) page</p>