title: HttpCookie class in aspnet core 2
body: <p>I'm converting a .net 4.7 MVC project to .net core 2, attempting to preserve as much of the code, as is, as possible. This project has a <code>BaseService</code> that <em>builds</em> an <code>AuthCookie</code> that's consumed by a few other services throughout the application.</p>
  
  <pre><code>// Create
  public HttpCookie AuthCookie { get; set; } = new HttpCookie(AuthUtils.CookieName);
  
  // Consume
  if (AuthCookie?.Value != null) { ... }
  </code></pre>
  
  <p>In .net 4.7, the <code>HttpCookie</code> class is included in the <code>System.Web</code> namespace, but doesn't seem to exist in .net core 2 in the same way. As in, a cookie is built and handled outside the context of a controller.</p>
  
  <p>I've seen:
  <a href="https://stackoverflow.com/questions/38346333/why-i-cant-use-httpcontext-or-httpcookie-asp-net-core-1-0">Why I can&#39;t use HttpContext or HttpCookie? (Asp.Net Core 1.0)</a></p>
  
  <p>That doesn't seem to address this question. Is the fundamental difference in authentication handling in .net core so big that this case can't be handled?</p>