Pregunta

So i get users getting disconnected with no reason (or better i don't know the reason).

On the login page i make a session:

Session.Add("UserProfile", username);

On the landing page

 string userNames = Session["UserProfile"] as string;
 if(userNames == null){
   Response.Redirect("~/default.cshtml");
}

On the Webconfig i've tried this

  <sessionState cookieless="UseCookies" timeout="240"> </sessionState>
  <httpRuntime maxRequestLength="252400" executionTimeout="1200" />
  <authentication mode="Forms"> <forms timeout="525600" slidingExpiration="true" /></authentication>

And the thing is... On the landing page i got a list where users can choose an id, enter on it and each have id have a form that the user can edit.

But very often when the user submit the form, he's redirected to the login page.

Any thoughts ?

¿Fue útil?

Solución

You have specified a forms authentication timeout value but you aren't actually using Forms Authentication so that won't have any effect. Sessions can be ended by App Pool recycling on the web server so it is perfectly possible for users to lose their session and therefore fail your landing page test. That will result in them being redirected to the home page.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top