I am at my wits end and am hoping someone can help me.
I have an asp.net/c# application which works fine on my laptop, in Production and I recently put in on a QA/Test server and a Development server. It works perfect everywhere except in Dev.
The first page is a logon page saved in a session. This username is used throughout the app; however, within a minute the user is directed back to the logon page. There are also other various session variables in the app that are used but these are also lost, or sometimes, as you are navigating through the app, the session values change to a previous value selected.
This is not consistent, it doesn’t always happen at the same place or in the same time frame.
I’ve searched the web for solutions and have ensured these things have been done:
- the server has .Net Framework 1.1 (apparently this was a bug in 1.0);
- it has IIS 6.0, and the options for this directory have “Enable session state” checked and the time is set for 20 minutes;
- Application pools is set to shut down worker processes after 1740 minutes and idle timeout is set at 20.
- the web.config is set at
“<sessionState mode="InProc" cookieless="false" timeout="3600" /> “ and,
<authentication mode="Forms">
<forms name="XXX" loginUrl="Logon.aspx" protection="All" timeout="3600">forms>
authentication>
- there is no virus software on this server.
- In IE browser (6.0), allow cookies is enabled, and under the advanced, privacy and security tabs, I’ve ensured everything is set exactly like the servers that are working correctly.
- The server has a standard name (no underscores)
I’m not sure what else to try, but this is driving my users insane. I really don’t believe it is in the code or web.config file since I do not have these problems on the other servers.
If anyone has any suggestions, I would greatly appreciate the advice.
Thanks.
rulec444Posted Jan 17, 2006, 10:55 AM
That was exactly what it was Lee. Thanks.
I found out that this was a Web Garden issue.
The server was setup (for some reason) to use the Web Gardening feature, allowing it to launch up to 15 individual w3wp.exe processes. Actually, the number of processes it allowed isn't the issue, the issue is that Web Gardening with InProc session state is not supported and will cause this behavior. ASP session info is kept in the w3wp process that generates when first logging in to my application. With Web Gardening, when you click other options on the page, it's likely to spawn one or more separate w3wp process and those processes do not know about the session state data, only the first worker process knows this information.
The default IIS 6.0 configuration only provides one worker process at a time...so basically, Web Gardening is disabled. After setting the server back to this default configuration it fixed the problem.
So, the Session State is working now.
Thanks so much for helping me.
LeePosted Jan 13, 2006, 2:35 AM
rulec444Posted Jan 12, 2006, 1:22 PM
Do you mean to change this in the machine.config file?
LeePosted Jan 12, 2006, 10:08 AM
Check you only have 1 worker process for the application.
I'm not sure if it's a bug or not, but I had the same problem when I was using multiple worker processes on server 2003 and IIS 6.
I hope this helps.