Exemplo n.º 1
0
 private void Load()
 {
     if (!_loaded)
     {
         try
         {
             var data = _cache.Get(_sessionKey);
             if (data != null)
             {
                 Deserialize(new MemoryStream(data));
             }
             else if (!_isNewSessionKey)
             {
                 _logger.AccessingExpiredSession(_sessionKey);
             }
             _isAvailable = true;
         }
         catch (Exception exception)
         {
             _logger.SessionCacheReadException(_sessionKey, exception);
             _isAvailable    = false;
             _sessionId      = string.Empty;
             _sessionIdBytes = null;
             _store          = new NoOpSessionStore();
         }
         finally
         {
             _loaded = true;
         }
     }
 }