private static SessionStateStoreData LoadSessionStateStoreData(HttpContext context, IMongoRepository repository, string id, TimeSpan sessionTimeout) { if (IsDebugEnabled) { log.Debug("세션 정보를 캐시에서 로드합니다... id=[{0}]", id); } With.TryAction(() => RemoveExpires(repository)); try { SessionStateItemCollection itemCollection = null; var entry = repository.FindOneByIdAs <MongoSessionStateEntry>(id); if (entry != null && entry.State != null) { itemCollection = WebTool.DeserializeSessionState(entry.State); if (IsDebugEnabled) { log.Debug("세션 정보를 캐시에서 로드했습니다!!! id=[{0}]", id); } } return(new SessionStateStoreData(itemCollection ?? new SessionStateItemCollection(), SessionStateUtility.GetSessionStaticObjects(context), (int)sessionTimeout.TotalMinutes)); } catch (Exception ex) { if (log.IsWarnEnabled) { log.Warn("MongDB에서 세션 정보를 로드하는데 실패했습니다. id=[{0}]", id); log.Warn(ex); } } return(null); }
private SessionStateStoreData LoadSessionStateStoreData(HttpContext context, string id, TimeSpan sessionTimeout) { if (IsDebugEnabled) { log.Debug("세션 정보를 캐시에서 로드합니다... id=[{0}]", id); } try { SessionStateItemCollection itemCollection = null; var bytes = CacheRepository.Get(id) as byte[]; if (bytes != null) { itemCollection = WebTool.DeserializeSessionState(bytes); if (IsDebugEnabled) { log.Debug("세션 정보를 캐시에서 로드했습니다!!! id=[{0}]", id); } } return(new SessionStateStoreData(itemCollection ?? new SessionStateItemCollection(), SessionStateUtility.GetSessionStaticObjects(context), (int)sessionTimeout.TotalMinutes)); } catch (Exception ex) { if (log.IsWarnEnabled) { log.Warn("캐시에 세션 정보를 로드하는데 실패했습니다. id=[{0}]", id); log.Warn(ex); } } return(null); }