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.
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.
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.