title: AspNetCore: OpenId Cookies always show expires=1969-12-31 even with IsPersistent=true and ExpireTimeSpan set
body: <p>Using ASPNETCORE OpenId authentication middleware and Cookie middleware. I always see that cookies from OpenId authentication are set to expire at 1969-12-31 (in Chrome debugger). I assume this means the cookies are SESSION cookies; I want to make them persistent cookies so the user will be prompted to login less frequently. So I added the ExpireTimeSpan and IsPersistent=true as suggested in other posts, but I still see that my cookie Expires is 1969-12-31. </p>
  
  <p>What am I doing wrong?</p>
  
  <p><a href="https://i.stack.imgur.com/nDHzg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nDHzg.png" alt="enter image description here"></a></p>
  
  <pre><code>        services.AddAuthentication(options =&gt;
          {
              options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
              options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
          })
          .AddAzureAd(options =&gt;
          {
              Configuration.Bind("AzureAd", options);
          })
          .AddCookie(p =&gt;
          {
              p.ExpireTimeSpan = TimeSpan.FromDays(30);
              p.SlidingExpiration = true;
          });
  
          services.Configure&lt;AuthenticationProperties&gt;(props =&gt;
          {
              props.IsPersistent = true;
              props.ExpiresUtc = new DateTimeOffset(DateTime.Now, TimeSpan.FromDays(30));
          });
  </code></pre>