title: use sessions in web service
body: <p>i am creating a web app in mvc5 in which i am passing my login information through session in web service </p>
  
  <pre><code>        if (pm != null)
          {
              string pm1 = pm.ToString();
              HttpContext.Current.Session["pm"] = pm1.ToString();
          }
  </code></pre>
  
  <p>here if my <code>string pm</code> is <code>not null</code> then the value of string pm will be stored in my session, but i am getting the error when i run my web service</p>
  
  <blockquote>
    <p>System.NullReferenceException: Object reference not set to an instance
    of an object.</p>
  </blockquote>
  
  <p>any other ways to do this?</p>