Problem with one global class

  • Thread starter Thread starter Ricardo Corsi
  • Start date Start date
R

Ricardo Corsi

hi,

I build one global class to store user data wich is logged in that moment.
Every thing is work fine , and this class is accessed by all other pages
from my project.
But, the problem is: when more than one user, log in in my system, this
class store user data just for only one user, overriding the others
users...it look like this class is in shared mode....
whats wrong ?

below, follow this class..

Global Class

----
Imports Web_intranet.Classes

Public Class ClasseGlobal
Public Shared UsuarioLogado As New Usuarios
End Class

-----
 
Well, of course they all share it. You declared the variable as 'Shared'.
That means there is one instance of it per application. So all your users
share it - and overwrite each other.

You need to use session variables, if you want to have each user access to a
unique variable.
 
hummm....thanks for your help Marina!

Marina said:
Well, of course they all share it. You declared the variable as 'Shared'.
That means there is one instance of it per application. So all your users
share it - and overwrite each other.

You need to use session variables, if you want to have each user access to
a
unique variable.
 
Back
Top