Actually, if you want to type objects, place them at the method level, for example:
public T GetValue<T>(string sessionKey) { }
The class level is greater if you have the same object in the session, but the session can expand to several types. I do not know that I will worry about session control; I would just let him do what he did for a while, and just provide the means to extract and store information in a more rigorous way (at least for the consumer).
Yes, indexes will not work; you can create it as an instance instead and make it static:
public class SessionManager { private static SessionManager _instance = null; public static SessionManager Create() { if (_instance != null) return _instance;
And so this is a static factory implementation, but it also supports a single point of contact through a static link to the session manager class inside. Each method in sessionmanager can wrap an existing ASP.NET session or use its own internal storage.
Brian mains
source share