How to make Asp.Net MVC application stop logging out, and stay logged in straight away?

0

I developed an application in Asp.Net MVC and this application when it is logged in and it takes some time without touching, when I am going to register, the system asks to log in again, I would like to know how to log in directly.     

asked by anonymous 25.07.2018 / 22:45

1 answer

0

I believe this behavior is tied to the cookie expiration time. Has a property in the file App_Start\Startup.Auth.cs

app.UseCookieAuthentication(new CookieAuthenticationOptions
  {
      ExpireTimeSpan = TimeSpan.FromMinutes(5),
      AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
      LoginPath = new PathString("/Account/Login")
   });

Change the value of set the ExpireTimeSpan value to a date far away.

    
25.07.2018 / 22:53