I’m looking for a design\pattern to my problem.
I want to declare a singleton variable in a web-development environment,
but I want it to be singleton per user per session.
i.e. MyClass.StaticVar will be initialized once for each client per session
and be globally accessible to that client.
What would you suggest?
What are all the caching options\levels possible in web-application BLL layer (I understand we can use Session dictionary only in aspx and ascx code behind. right?)
I do something like:
You may add locking (
lockstatement) in the above example to make it thread-safe.