Last post Mar 25, 2011 10:24 AM by cubangt
Mar 22, 2011 02:26 PM|dlpfis|LINK
I've got a local intranet where i store some session variables between pages. The site is on a standalone windows 2k3 box.
We recently started virtualizing, and the DEV copy of the site now lives on a Virtualized 2k8 box. I wrote a very basic page that creates a session variable but when the user is directed to the next page, the session has lost it's value.
To simplify things i made two very generic pages. No master pages, no AJAX, nothing but a label on one and a text box and button on the other to set a session variable. Again, when i set the session variable on Page A, I can see a value in the session. When
i go to the other page (either through a site map menu, typing the new page into the browser, or hitting a link, the session is set to null again.
Anyone have any ideas on where to start with solving this issue?
Mar 22, 2011 04:18 PM|cubangt|LINK
See if this other post helps trouble shoot some..
Mar 23, 2011 02:41 PM|dlpfis|LINK
Hello. I tried some of the things outlined in that thread, namely adding the session tags to my web.config and setting it to using State Server. The Web.Config on my PRD box didn't have any session settings. The Dev site still runs, but again no Session
variables are persisting.
I also cheked to make sure the ASP service referenced in the other thread was running.
This is quite a weird problem, the only difference between the two sites (other than ones uses the PRD Db and one uses the DEV db) is that they are on different boxes. THe code is the exact same.
Mar 24, 2011 11:26 AM|cubangt|LINK
If you have a global.asax file in either site, you may want to check if there is any code within the Session logic
protected void Session_Start(object sender, EventArgs e)
protected void Session_End(object sender, EventArgs e)
Also, have you checked how long the sessions last, default is 30 minutes, but could be adjusted to be longer and shorter, which is within IIS, example can be seen here
Mar 24, 2011 12:33 PM|dlpfis|LINK
Thanks for that reply. If nothing else I learned more about the various places that can affect session state.
I looked at the suggestions on there. On my PRD box (i.e. the one that is handling session data correctly) this all looks to be on the same settings.
My DEV box is on 2008, and IIS looks completely different. I ended up in the sessionstate area trying to figure out something in that regards.
It seems in 2008 there are three session options now, inProc, SQL, and the ASP Service. Now keep in mind, back when i set up my prd box, i didn't configure a thing for Sessions, they just worked when i started using them. In the flavor of IIS running on
2008 there are suddenly all these options, and i noticed that as i changed from trying to use the service to InProc, it was editing the web.config file of the DEV website as well.
However, none of these changes ended up making a difference. This is very frustratiing.
I also took the time to check my global.asx, but there's nothing in there that is resetting the Sesion variables i'm trying to set in these other places. Again, the code in dev and prd are the exact same except for one SQL connection in the web.config, yet
PRD works and DEV doesn't.
The only difference that i can see is Win2k3/IIS6 vs Win2k8/IIS7, but i just can't figure out how to get 7 to work like 6 does. This is quite a problem for me since I'm being pushed to migrate my production server to our virtualized boxes (i.e. Win2k8).
Mar 24, 2011 12:42 PM|dlpfis|LINK
If there's any screen shots of code or IIS configuration that would be helpful in trouble shooting this please let me know. I'll be happy to provide whatever.
Mar 24, 2011 01:34 PM|cubangt|LINK
So far i havent experienced this issue and we are also on win2008 and IIS7
check out this post:
One of the answers here( Check the Windows Event Log to ensure that the Worker Process is not being forced to recyle. There may be something in your code that causes the Worker Process to force itself to recyle in which case when the session is stored inProc
it will loose all session values it's holding.)
Mar 25, 2011 08:54 AM|dlpfis|LINK
Here's an update on the issue.. One of the server folks got the idea to try referencing the URL by IP instead of name, and the sessions work. When I try to use the server name (A record in DNS) it does not work. Hope this sheds some light on the subject.
Once again thanks for all of the replys.
Mar 25, 2011 09:15 AM|dlpfis|LINK
And the issue has been resolved. The big difference in the url was i had appended '_dev' to the dev sitename. Apparently sessions hates underscores.
Mar 25, 2011 10:24 AM|cubangt|LINK
I had issues with session naming, but dont recall if it was due to underscores..glad you got it worked out.