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

Asked

Viewed 103 times

0

I developed an application in Asp.Net MVC and this application when the login is done and spends time without moving, when I will register, the system asks to log in again, I would like to know how to be logged in direct.

1 answer

0

I believe this behavior is tied to the expiration time of the cookie. There’s a property on 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 configure the Expiretimespan value for a very long date.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.