title: Object Reference error when reading cookie from an external class
body: <p>I have a cookie with a users authentication data set via:  </p>
  
  <pre><code>HttpContext.Current.Response.Cookies.Add(new HttpCookie(FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(ticket)));
  </code></pre>
  
  <p>Now, when I try read the cookie from another class using:  </p>
  
  <pre><code>HttpCookie myCookie = new HttpCookie(FormsAuthentication.FormsCookieName);
  myCookie = HttpContext.Current.Request.Cookies[FormsAuthentication.FormsCookieName];
  </code></pre>
  
  <p>I get an <code>Object reference not set to an instance of an object</code> error.<br>
  I've checked my browser cookie and the <code>.ASPXAUTH</code> cookie is there with data.</p>
  
  <p>Can anyone tell me where I'm going wrong? I've tried with both <code>request</code> and <code>response</code></p>
  
  <p><strong>Edit:</strong> <code>HttpContext.Current.Request.Cookies.Get</code> returns the same error</p>
  
  <p><strong>Edit2:</strong> Seems as if <code>HttpContext.Current</code> is <code>null</code></p>