hello guys how r u ?
my question is that, how we can create session in global.asax for the whole application in asp.net using c# ?
Reply Soon
Thanks.
Global.asax
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jean PaulRank #32 · 38.5K reputationPosted Nov 2, 2011, 12:29 AM EDT
The sessions are per user basis. The session of one user should not interfere with another user's session.
I believe your purpose is to share some object throughout the entire application. If this is the case you ca use the following methods.
1) Use Cache object with is thread safe. The object stored on Cache will be visible to all the users. So inside the Global.asax you can create the object and place in the Cache. It contains the key, value and expiry properties
Eg: Cache.Insert("key", "value")
2) Use Application object
Eg: Application["key"] = "value";
3) Use a static property
Regards,
Jean Paul