HTTP服务器软件系统的设计与实现(10)
时间:2017-02-21 13:09 来源:毕业论文 作者:毕业论文 点击:次
ApplicationSettings settings = sessionMgr.Info; string sessionKey = string.Empty; /// /// 现在我们检查,如果已经存在任何会话是SessionManager /// switch (settings.SessionType) { case ApplicationSessionMode.SingletonSession: /// /// SingletonSession /// application = sessionMgr.GetOrCreateSingletonInstance(); return true; case ApplicationSessionMode.BrowserSession: /// /// 我们需要一个会话密钥identfy particolare浏览器 /// sessionKey = e.Rawrequest.Connection.IP + "@" + e.Requests["User-Agent"]; break; case ApplicationSessionMode.IpSession: /// /// 我们需要一个会话密钥,identfy一个IP地址 /// sessionKey = e.Rawrequest.Connection.IP.ToString(); break; } application = sessionMgr.GetOrCreateInstanceBySessionKey(sessionKey); return true; } (责任编辑:qin) |