title: Store/validate JWT token stored in HttpOnly cookie in .net core api
body: <p>I added jwt based auth to my api, works with adding the token to the header (Authorization : Bearer {tokenhere}). </p>
  
  <p>I had a look into how to store it on the client side, and the most recommended method was to use HttpOnly cookie, which is set on the server, so client code cannot access it. The browser will get it and attach it to future requests.</p>
  
  <p>For this to work, the server has to write this cookie in a response, and be able to validate it instead of the token in the header (Authorization : Bearer {tokenhere}).</p>
  
  <p>How do I set this up? I searched how and low, and didn't find a tutorial on this, it's either cookie or jwt, never jwt stored as an httponly cookie.</p>