OnTheAnvil
Regular
I started a failry large project 4 months ago and I needed to pass variables between forms. I asked a guy I work with what he thought the simplest way to do this was. He recommended creating a new Gbl.vb class file and then inside it placing code like this...
Module Gbl
Public gUserName As String
Public gSecurityLevel as String
End Module
This way all I have to do is from anywhere in my code, either a class or a form, I can make statements like this txtBox1.Text = gUserName
The only problem is that now after 4 months of coding and using this module to hold about 30 different global variables I've found a huge problem. When one user logs on as USER1 their username is displayed at the top of the page as they conitnue to work like it should be. However, when USER2 logs in the global variable changes for both people and both people's browsers report that they are logged in as USER2. Huge problem! This means that if 50 people log in everyone has the username and security permissions of the last person who logged in. I was told by the same person who recommened that I use this that they had tested it before and it worked for them. They suggested maybe it was an IIS setting.
Anyway I know I should have used session variables now but converting to that is going to take a huge amount of time. Is there anyway I can force this module to make those Public variables session dependent so each new session keeps track of their own variables instead of everyone sharing one set?
If not could you please offer a suggestion on how to change my code fairly quickly. I'm in a time crunch right now.
Thanks,
OnTheAnvil
Module Gbl
Public gUserName As String
Public gSecurityLevel as String
End Module
This way all I have to do is from anywhere in my code, either a class or a form, I can make statements like this txtBox1.Text = gUserName
The only problem is that now after 4 months of coding and using this module to hold about 30 different global variables I've found a huge problem. When one user logs on as USER1 their username is displayed at the top of the page as they conitnue to work like it should be. However, when USER2 logs in the global variable changes for both people and both people's browsers report that they are logged in as USER2. Huge problem! This means that if 50 people log in everyone has the username and security permissions of the last person who logged in. I was told by the same person who recommened that I use this that they had tested it before and it worked for them. They suggested maybe it was an IIS setting.
Anyway I know I should have used session variables now but converting to that is going to take a huge amount of time. Is there anyway I can force this module to make those Public variables session dependent so each new session keeps track of their own variables instead of everyone sharing one set?
If not could you please offer a suggestion on how to change my code fairly quickly. I'm in a time crunch right now.
Thanks,
OnTheAnvil