title: What does `HTTPContext.SignInAsync` do behind the scenes?
body: <p>I am interested in building my own login system, which keeps me away from the out of the box <code>Identity</code>, which hides a lot of details.</p>
  
  <p>I was taking a look at Authentication using cookies.</p>
  
  <p><a href="https://dotnetcoretutorials.com/2017/09/16/cookie-authentication-asp-net-core-2-0/" rel="noreferrer">https://dotnetcoretutorials.com/2017/09/16/cookie-authentication-asp-net-core-2-0/</a></p>
  
  <p>Talking about the details of signing process which happens behind the scenes (saving sessions, cookies, writing something to the database, etc...). I am interested to know:</p>
  
  <p><strong>What does <code>HTTPContext.SignInAsync</code> function do to my HTTP request and response exactly? Or in other words, how does this function sign someone in?</strong></p>