User logged out frequently (default membership provider)

I have an asp.net mvc 3 site hosted on a shared hosting. My problem is that my site often logged out automatically after 5-10 minutes. Although I set the time to 200 minutes in web.config and application_start, as shown below.

<forms loginUrl="~/Account.mvc/index" slidingExpiration="true" timeout="200" protection="All" /> HttpCookie authCookie = FormsAuthentication.GetAuthCookie(userName, rememberMe); FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(authCookie.Value); FormsAuthenticationTicket newTicket = new FormsAuthenticationTicket(1, userName, DateTime.Now, DateTime.Now.AddMinutes(200), rememberMe, CurrentUser.UserID +"|"+ CurrentUser.EmployeeID); authCookie.Value = FormsAuthentication.Encrypt(newTicket); Response.Cookies.Add(authCookie); 
+5
source share

Source: https://habr.com/ru/post/943990/


All Articles