Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a website on windows server 2008 and iis 7 on a VPS. It works fine and has no problems, but after moving it to a shared hosting server with IIS 7.5, the session is lost after 4 or 5 clicks (like 30 secs) and I have to login again and again.

The two sites are same, I copied the site from the VPS exactly as-is to the shared hosting server.

The session timeouts in both web.config files are same.

On the shared hosting server I don't have access to IIS manager to manipulate the settings. All I have is Plesk Control Panel 9.5 and the website's web.config file.

What could be causing this to happen?

share|improve this question

migrated from Nov 26 '11 at 14:34

This question came from our site for professional and enthusiast programmers.

Are you running a web garden or web farm? Could the issue be how your managing your sessions? – Chris Felstead Nov 25 '11 at 17:42
No its on shared Hosting,web.config setting is fine and all session state related attributes set to proper value, the website works fine on vps with windows server 2008 x86. – Mehdi Mousavi Nov 26 '11 at 5:50
You say session state is fine, your problem seems to contradict this. Can you please confirm how you are managing your session state. I suspect it's in-proc which means I'm right and you should follow Ragesh's advice. – Chris Felstead Nov 26 '11 at 6:27
You are using InProc session state. This means the users session is being stored by 1 processor on the server. When the user requests another page it may not be the same processor (or server) that handles the request. As such, a new session is started. You need to follow Ragesh's advice. – Chris Felstead Nov 26 '11 at 13:32
@Chris Felstead: That's not true. InProc means In-Process, not in-ProcessOr, it's being stored by one Process, not processor. – TristanK May 27 '12 at 2:25

Shared hosts sometimes have unusually frequent application pool recycles. This could result in your sessions getting wiped out if you're using in-process session state. You can work around this by moving your session state out of process. Since it's a shared host, I'm guessing your only option really is to keep your session state in a database.

Check out the MSDN page on Session-State modes for details on how to do this.

share|improve this answer
thanks for your answer.I guess your's something about recycling but I don't know why and what cause to it.In setting section in plesk control panel the max cpu usage set to 25%.can this be a problem to recycling? – Mehdi Mousavi Nov 26 '11 at 5:38
There are a whole bunch of reasons why this could be happening. Maybe your host has incorrectly configured your application pool. Maybe the host is sharing application pools with other apps and somebody else's app is causing it to recycle. Your best bet is to work with your host's support folks to get to the bottom of this. – Ragesh Nov 26 '11 at 9:25
There're two common techniques of CPU throttling: the built in one which terminates the worker process (i.e. recycles) when the CPU limit specified is reached, and the Job Object based constraint technique used by WSRM. Depending on the host, you might find that this CPU limit causes the process to terminate rather than throttling it. – TristanK May 27 '12 at 2:26

Are you using Form Auth? If yes please try this out on your Web.config file:

    <authentication mode="Forms">
          <forms timeout="50"/>

    <sessionState timeout="60"  />

Good luck!

share|improve this answer
thanks for your attention but I have set all of the related code to the sessionstate In webconfig.Its not about it I said that this website works fine on windows server 2008 x86. – Mehdi Mousavi Nov 26 '11 at 5:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.