title: ASP.NET Core MVC 2.1.0 session is not working after publishing in IIS-10
body: <p>I want to keep some values in Session as I can access those values in application. It is working fine on localhost. But when I tried to access remotely/from server after publishing, it is not worked. the session value is null.</p>
  
  <p>I am using .NETCoreApp,Version=v2.1 with "Microsoft.AspNetCore.Mvc": "2.1.1". </p>
  
  <p>HomeController.cs:</p>
  
  <pre><code>using System;
  using System.Diagnostics;
  using System.Linq;
  using Microsoft.AspNetCore.Mvc;
  public class HomeController : Controller
  {
      public IActionResult Index()
          {
              HttpContext.Session.SetObjectAsJson("key", "Test value");           
              return View();
          }
      public IActionResult About()
          {          
              ViewBag.SessionValue = 
                   HttpContext.Session..GetObjectFromJson&lt;String&gt;("key");
              return View();
          }
  }
  </code></pre>
  
  <p>About.cshtml:</p>
  
  <pre><code>@{
      ViewData["Title"] = "About";
  }
  &lt;body&gt;
    Value:    @ViewBag.SessionValue
  &lt;/body&gt;
  </code></pre>
  
  <p>Here during running from Visual Studio 2017 it shows in About page
  Expected Result:</p>
  
  <pre><code>Value: Test Value
  </code></pre>
  
  <p>But after publishing in windows server 2016 IIS 10.0, it shows in About page
  Actual Result:</p>
  
  <pre><code>Value:
  </code></pre>