title: OWIN Cookie authentication not working on IIS 8.5
body: <p>I have developed an ASP.NET webapp with OWIN authentication, which works fine on my development machine (Windows 10/IIS 10), but when the webapp is published to my Windows 2012 server with IIS 8.5, the cookie authentication does not seem te work.</p>
  
  <p>When I login (with the IsPersistent setting to true) and close the browser, I am still logged on when I start my browser again, so that's OK. But when I restart IIS and startup the browser, I have to logon again.</p>
  
  <p>I have created a very simple application to test this, with the following code:</p>
  
  <p><strong>Startup.cs</strong></p>
  
  <pre><code>public void ConfigureAuthentication(IAppBuilder app)
      {
          app.UseCookieAuthentication(new CookieAuthenticationOptions
          {
              AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
              LoginPath = new PathString("/Login"),
              CookieName = "ThisIsTheAuthCookie"
          });
      }
  </code></pre>
  
  <p><strong>AuthenticationController.cs</strong></p>
  
  <pre><code>public ActionResult Login(string userName, string password)
      {
          //For testing purposes every user/pwd is fine
          var identity = new ClaimsIdentity(new [] { new Claim(ClaimTypes.Name, userName), },
              DefaultAuthenticationTypes.ApplicationCookie,
              ClaimTypes.Name, ClaimTypes.Role);
  
          HttpContext.GetOwinContext().Authentication.SignIn(new AuthenticationProperties { IsPersistent = true }, identity);
  
          return RedirectToAction("index", "home");
      }
  </code></pre>
  
  <p>Even Chrome shows the cookie, but it looks like OWIN is not using it on IIS 8.5:
  <a href="https://i.stack.imgur.com/5YyC1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5YyC1.png" alt="enter image description here"></a></p>
  
  <p>Does anybody have an idea what the problem is?</p>
  
  <p>Thx,
  Danny</p>