jafesler
jafesler

Reputation: 117

Session Variable not holding values in production in ASP.NET

I have a Session variable holding a boolean value. It works just fine in on my development machine and my development server. When I move my code to production it no longer works.

It doesn't matter if I'm using a cookieless session either, so it can't be a timeout issue or a cookie issue.

It happens on all modern browsers.

I'm using the Response.Redirect overload where the endResponse parameter is set to false.

The machine is not in a webfarm.

Session storage is to my knowledge InProc, it is not in SQL Server.

The session variable holds the boolean variable at least once, because I print it out in a label on the page following my setting of the variable and the Response.Redirect. But afterward it gets set back to NULL, it does not do this in development.

Its all the same code, but the IIS settings might be different on production, I just don't know where to look.

Upvotes: 0

Views: 2781

Answers (2)

Hector Sanchez
Hector Sanchez

Reputation: 2317

Is your application being called by an iframe or somethnig? I had this problem once, Icouldn't find a solution, I'm still looking for one I solved this problem integrating the application in the same server as the application who loaded our app in an iframe.

Hope it helps you.

Upvotes: 1

Chris Marisic
Chris Marisic

Reputation: 33128

Yikes this could turn into a nightmare of a problem.

Do you have a completely independent and clean machine you can deploy your project to and see if you can replicate the behavior on another IIS that is in a known state?

Do you have the ability to just reimage the server?

Check settings on the server's applicationHost.config and machine.config to see if the session is set to use InProc or Sql based session persistence. If it's sql based is the database screwed up?

Assuming the session is InProc like you expect, is IIS reseting constantly? Do trace logging of your application start and end events.

Upvotes: 2

Related Questions