1

I have been developing an ASP.NET MVC 4 (with razor) WebApp, that worked great in Debug, and even in Release on my local machine.

Now I uploaded it to the server, and while you are navigating it suddenly, from time to time closes your user session, asking for username and password again.

Any idea of why? Maybe I am losing some configuration or settings requirements, but its driving me mad.

Erik Philips
  • 53,428
  • 11
  • 128
  • 150
Vicenç Gascó
  • 1,326
  • 2
  • 13
  • 21

2 Answers2

3

It looks like you are confusing Session with Authentication. You probably need to enable FormsAuthentication.SlidingExpiration Property so you aren't automatically logged out.

<authentication mode="Forms">
  <forms loginUrl="member_login.aspx"
         name=".ASPXFORMSAUTH"
         cookieless="UseCookies"
         requireSSL="true" 
         slidingExpiration="TRUE" />
</authentication>
Erik Philips
  • 53,428
  • 11
  • 128
  • 150
1

I think that your Session expires after 20 minutes. take a look here: What is default session timeout in ASP.NET?

Also you'll find the solution for your problem, that is to set Session timeout..

Community
  • 1
  • 1
dan8912
  • 31
  • 1
  • 7