One of the reasons I wrote this:
http://sholliday.spaces.live.com/blog/cns!A68482B9628A842A!125.entry
was so that I could "un-orphan" items more cleanly.
And do a .Clear() as well.
Ex:
I have a page that shows an EmployeeByDept report.
Ok...I get the data, and cache it.
So while the user is on
employeebydept.aspx
I want the page .. in session.
This allows me to sort, filter the data from session while they're on that
page, and I only hit the db one time.
When they navigate away from employeebydept.aspx page, I want to un-orphan
the data.
I call the
dataStore.Remove( MY_KEY_NAME);
and its gone.
Make sense?
Take a look, its basically a session bases Singleton object....for each
user.
I never code against the Session object directly anymore.
CHeck my blog, I have a Generic version as well, which gives you strong
typing.