0

I uploded my Asp.Net 4 on a shared server. Every thing going right on the client , but when I upload it on my host provider , my session expired to early

this is my WebConfig code :

<sessionState timeout="160"  />

Then I tried to use another shared server , and every thing going right!!! I just have this problem on that server

Is there anyone out there to help me about this problem?!!

thanks

Ali Foroughi
  • 4,540
  • 7
  • 42
  • 66

1 Answers1

2

You are storing your session inproc, that is a default setting, and if application pool for your site restarts session is also restarted. Hosters offted put number of sites on same application pool and there is a numbers of reasons for app pool restart (changing web.config, something in bin folder etc.)

To be sure that this is a reason for session restarting, log application restart event, here are the details : https://stackoverflow.com/a/10620279/351383

If application restart is a reason, there is a nothning you can do except change session mode to SQL server or state server, see http://msdn.microsoft.com/en-us/library/ms178586.aspx. But only if your hoster support that.

Community
  • 1
  • 1
Antonio Bakula
  • 20,445
  • 6
  • 75
  • 102