I have a love/hate relationship with the ASP.NET Session. It's such a convenient place to put things, but when you start putting applications into production there are a number of less-than-obvious edge cases that can come up and bite you.
Most often the Session is used when managing state over a long process like a multi-step wizard or questionnaire. However, when people use the Session, they often lean on it a little. They'll bake it into their design so deep that when it doesn't work, they're screwed. That's not to say they shouldn't be able to lean on it, I'm just saying that there's a lot of things going on with Session (not just on ASP.NET, but other frameworks as well) in order to get it to look seamless.
ASP.NET offers three options (four if you count rolling your own).
There's a number of things that can go wrong, some of which I mention above, but here's what I usually run through when troubleshooting things.
At my last company Session became such a hassle for large high traffic applications that we just stopped using in-proc and started exploring alternatives.
Related Links you might enjoy
How do you manage state at your company?
[Serializable] [System.Runtime.InteropServices.ComVisible(false)] public class Dictionary<TKey,TValue>: IDictionary<TKey,TValue>, IDictionary, ISerializable, IDeserializationCallback {
Ads by The Lounge