September 10th, 2003, 08:07 AM
Maintaining Session State
I am developing an intranet application for our office network using asp, SQL server and IIS.
Version 1 of the application is has worked absolutely fine up to now.
This morning, I "installed" version 2 onto the server and all works well apart from one really annoying thing...
Session variables are not maintained across pages.
The login page creates two session variables, empID and Admin using the following asp code:
...then it redirects to another page as follows:
...jobs.asp cannot then find the session variables.
I have performed a few error-checking tests and found out that between any two pages, the sessionID is not the same. Therefore, i am under the impression that the server is not maintaining session state.
IIS is configured to enable session state with the timeout at a default 20mins.
Anyone got a clue what is going on? I am baffled, as i have used session variables in version 1 with no problems at all and no configuration has changed since then.
September 10th, 2003, 01:51 PM
September 11th, 2003, 03:03 AM
Cheers for the link...however, i'm certain that i both have cookies enabled and have not got any code like that.
One article from microsoft I was looking at suggested that a security patch stops session state between requests. Link below:
In short, The suggested resolution was to ensure that the server name was alphanumeric (it is) and to browse using the ip address (i was already)
After a few hours of trying different things, I gave up and went home!
This morning, I am in the process of reinstalling :@ How annoying
September 11th, 2003, 12:36 PM
One other thought, afaik if your redirect is in a different web application from the redirecting page you'll lose your original session state.
September 12th, 2003, 02:50 AM
There was no joy after the reinstall.
I set all of the settings in iis to be exactly the same as on my development machine (which did work) and still no change.
Finally, I decided to just start messing about with the settings randomly and guess what, it started working!
I honestly have no clue what I did or why it works now when it didn't before.
I think I may have been playing with the application settings so, like Doug G said, i may have put some of my files in a different application.
Anyway, cheers for your help..no doubt that I will need it again sometime soon!
September 12th, 2003, 12:55 PM
I'm glad you got it going. Can't argue with success however it occurs