This should work - I already did this in the project before.
I have a class that has a static property like this -
public class AppManager { public static RequestObject RequestObject { get { if (HttpContext.Current.Items["RequestObject"] == null) { HttpContext.Current.Items["RequestObject"] = new RequestObject(); } return (RequestObject)HttpContext.Current.Items["RequestObject"]; } set { HttpContext.Current.Items["RequestObject"] = value; } } }
And then RequestObject contains all my user data, so in my application I can do
AppManager.RequestObject.CustomProperty
So far, I have not encountered any problems in the way HttpContext.Items works.
source share