Ejemplo n.º 1
0
        private async void StoreSession(int id, string sessionData)
        {
            CreateAuthenicatedSession createSession = HttpContext.Session.GetObject <CreateAuthenicatedSession>(AUTHENTICATED_SESSION_KEY);

            if (createSession != null)
            {
                createSession.SessionData = sessionData;
                HttpContext.Session.SetObject(AUTHENTICATED_SESSION_KEY, createSession);
            }
            else
            {
                byte[] encryptedSessionData = await encryptionService.Encrypt(sessionData);

                authenticatedSessionRepository.StoreSession(id, encryptedSessionData).Wait();
            }
        }
Ejemplo n.º 2
0
        private async void StoreSession(int id, string sessionData)
        {
            byte[] encryptedSessionData = await encryptionService.Encrypt(sessionData);

            await authenticatedSessionRepository.StoreSession(id, encryptedSessionData);
        }