title: Set & Get Cookies in Asp.net core
body: <p>Using asp.net core 2.0 mvc c#</p>
  
  <p>I have 2 applications within the same domain ie </p>
  
  <pre><code>www.mydomain.com/app1 
  www.mydomain.com/app2 
  </code></pre>
  
  <p>There is a link on the first application app1 which one clicked redirects to my second application app2.</p>
  
  <p>I want to pass an ID from app1 to app2. I have tried querystrings. Though I am successfully able to set that its difficult to maintain/pass those in my app2 when there are redirects going from one page to another.</p>
  
  <p>So I thought of using cookies.
  What I want is when the user clicks on link in app1 a cookie is set, I am redirected to app2 and here I want to check the cookie that was set.</p>
  
  <p>I want to check the cookie in the actionfilter as below:</p>
  
  <pre><code> [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = false)]
  public class MyCustomFilter: ActionFilterAttribute
  {
     public override void OnActionExecuting(ActionExecutingContext context)
      {
        //Here I want to check my cookie
  
      }
  }
  </code></pre>
  
  <p>I tried with HttpContext.Response.Cookies.Get but this does not exist.</p>
  
  <p>Any pointers please.
  Thanks</p>