我有两个处理程序。
在 Authentication.ashx 处理程序中,我在会话中保存一个对象,如下所示:
HttpContext.Current.Session["ConnectionUserSession"] = userCache;
然后,我有另一个处理程序,Send.ashx,我想获取保存在 Authentication.ashx 中的对象。
我该怎么做?我获取对象的代码是:
UserCache userCache = (UserCache) HttpContext.Current.Session["ConnectionUserSession"];
问题:userCache 始终为空,并且我在两个处理程序上都实现了 IRequiresSessionState。