Session timeout is very short on IIS 7.5

asp.netiis-7.5session

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?

Best Answer

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.