title: How to share Session in ASP.NET Core 3 between 2 servers?
body: <p>How does one share session in ASP.NET Core 3 between 2 servers (load balanced)?
  And can session be shared between several web services/APIs and the main ASP.NET MVC app?</p>
  <p>I am very new to .NET Core 3, I was used to working with session state in ASP.NET Framework MVC (where it was as simple as using the same machine key in the IIS configuration of the site) but I've learned that everything changed for .NET Core 3, in addition a lot of documentation is extremely outdated/obsolete as new versions have rolled out, .NET core 1 has nothing to do with later versions and 2 with 3, and also it requires many NuGet packages which may or may not work anymore.</p>
  <p>Currently I have successfully implemented SQL session store with .NET Core 3 but the option of machine key no longer shows up in the IIS and I really don't know how to configure them in the <code>appsettings.json</code> file (if still used at all).</p>
  <p>Our setup is 2 servers which must both share the session info, with an F5 load balancer, our old apps which use .NET Framework MVC are configured like this, and I need help with achieving the same result but with .NET Core 3.</p>
  <p>I read through <a href="https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/web-farm?view=aspnetcore-3.1" rel="noreferrer">https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/web-farm?view=aspnetcore-3.1</a> but it doesn't really explain how to actually do anything</p>
  <p>Also this <a href="https://docs.microsoft.com/en-us/aspnet/core/performance/caching/distributed?view=aspnetcore-3.1" rel="noreferrer">https://docs.microsoft.com/en-us/aspnet/core/performance/caching/distributed?view=aspnetcore-3.1</a> helped configure the SQL session storage but not how to share between the 2 servers</p>
  <p>As well as <a href="http://www.intstrings.com/ramivemula/articles/jumpstart-44-sql-server-based-session-state-in-asp-net-core-mvc-application/" rel="noreferrer">http://www.intstrings.com/ramivemula/articles/jumpstart-44-sql-server-based-session-state-in-asp-net-core-mvc-application/</a></p>