Global objects

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi.

I am developing an ASP.NET application. I have several classes that I
developed that store user information and certain things that they do while
working with the application.

All those classes need to be available from the time user signs in to the
application and until user logs out. Also, they need to be local to the
user who is logged in to the current session. How should I create those
object instances so they are local to the user and seen from any page within
the application? Thanks for the help.
 
Thanks. I am doing it with some variables but the object I need to be
available for the duration of the user session are big and it affects
performance so I do not want to use session variables. I was wondering if
there is another way to do so.

Alex Korchemniy said:
Simply use HttpSessionState like this:

Session["key"] = value;

See more on MSDN:
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconsessionstate.asp

Alex Korchemniy

David said:
Hi.

I am developing an ASP.NET application. I have several classes that I
developed that store user information and certain things that they do while
working with the application.

All those classes need to be available from the time user signs in to the
application and until user logs out. Also, they need to be local to the
user who is logged in to the current session. How should I create those
object instances so they are local to the user and seen from any page within
the application? Thanks for the help.
 
Back
Top