shailendra
shailendra

Reputation: 205

asp.net mvc my web application is auto logout

I have created an asp.net mvc web application, it's working fine on localhost but when I upload it, users will get logged out automatically while they are working.

I used:

FormsAuthentication.SetAuthCookie(dbuser.FName, false /* createPersistentCookie */);

and in Web.config:

<authentication mode="Forms">  
    <forms loginUrl="~/home/login" timeout="2880"     />  
</authentication>

I tried a lot of things but didn't find a solution. How can I prevent the auto logout from happening?

Upvotes: 0

Views: 1178

Answers (3)

shailendra
shailendra

Reputation: 205

At last I have to change my whole coding converting into cookie base user module

Upvotes: 0

user32826
user32826

Reputation:

Ensure that where ever you are hosting it is hosting it as a single instance or handling the session state in an instance-independent manner - ASP.net does not automaically handle session transfers in web gardens or farms. The moment your client hits the other server, they will be logged out.

If you are hosting it on AppHarbor with two web workers for example, you will need to handle the state setup yourself.

Upvotes: 2

Kapil Khandelwal
Kapil Khandelwal

Reputation: 16144

Have you tried setting:

Session Timeout Value

  <system.web>
    <sessionState mode="InProc" timeout="20"/>
  </system.web>

Upvotes: 0

Related Questions