Bruno Monteiro
Bruno Monteiro

Reputation: 166

How to save a temporary table per session?

My main objective here would be to save a "temporary" table (data) per session. Working like the Session (HttpSessionStateBase).

Thing is, I need a configuration file to be loaded before anything. Save it (the xml data already parsed) somewhere to be accessed while that user (there is no login) is active and clear it after the browser is closed. And repeat all this again for a different session.

Upvotes: 0

Views: 612

Answers (1)

OnoSendai
OnoSendai

Reputation: 3970

You may store objects on a Session context, like this:

SampleDataTableClass _obj = new SampleDataTableClass();
HttpContext.Current.Session["config"] = _obj;

But you mentioned that the data is reflecting a configuration file. Would the scope of that configuration be the same for all Sessions? In that case, you may want to check on the Application class:

Application["config"] = _obj;

Upvotes: 1

Related Questions