Exemplo n.º 1
0
        public void Save(string sessionKey, IDictionary <string, object> sessionState)
        {
            if (!_directory.Exists(_path))
            {
                _directory.Create(_path);
            }
            var sessionFilename = Path.Combine(_path, sessionKey);

            var bytes = _sessionStateSerializer.Serialize(sessionState);

            _file.WriteAllBytes(sessionFilename, bytes);
        }
Exemplo n.º 2
0
        public byte[] Serialize(IDictionary <string, object> sessionState)
        {
            var unprotectedBytes = _innerSessionStateSerializer.Serialize(sessionState);

            return(ProtectedData.Protect(unprotectedBytes, _additionalEntropy, DataProtectionScope.CurrentUser));
        }