Access to Session Object Property

D

Dorsa

Hi, I am new to ASP.net and VB.net. I need to store a
class(SecurityClass) with a property ( LoggedIn as Boolean) in the
Session Object (Called SecurityObj) or ( As a session Object?) (Any
difference?)
I need to have access to the LoggedIn Property in the SecurityObj
which is in the session object.
I need to check if it's True or False.
Could you please give me solution?
Thanks
Dorsa
 
C

Chris Jackson

Well, you could store an object using:

System.Web.SessionState.HttpSessionState.Add(string name, object value);

However, if the only thing this object does is hold a boolean value, it
would be more efficient to store it using a value type, rather than wrapped
in a reference type encapsulating a value type.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,816
Messages
2,569,710
Members
45,496
Latest member
KristoferH

Latest Threads

Top