C#C
C#3y ago
nahr

❔ Authentication with owinCookie

Hi,

I have an issue with the ExpireTimeSpan prop.

   services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
                .AddOwinCookie(CookieAuthenticationDefaults.AuthenticationScheme, 3, options =>
            {
                options.Cookie.Name = "random";
                options.ExpireTimeSpan = TimeSpan.FromMinutes(1);
                options.LoginPath = "/Account/Login";
            });

Why does not the cookie get cleared after 1 minute?

If I add IsPersistent = true it works...
but I dont want to use IsPersistent = true
  var authProps = new AuthenticationProperties
            {              
                IsPersistent = true,
                IssuedUtc = DateTime.UtcNow
            };


Any ideas?
Thx!
Was this page helpful?