internal string CreateSession(User user) { var creatingTime = DateTime.Now; var stringBuilder = new StringBuilder(); stringBuilder.Append(creatingTime); stringBuilder.Append(user.Email); stringBuilder.Append(user.HashPassword); string input = stringBuilder.ToString(); string key = new Md5CryptoService().CalculateMd5Hash(input); var session = new SessionInfo(new UserModel(user), creatingTime) { IsLogged = true }; session.SessionKey = key; sessions.Add(key, session); return key; }
internal string CreateSession(User user) { var creatingTime = DateTime.Now; var stringBuilder = new StringBuilder(); stringBuilder.Append(creatingTime); stringBuilder.Append(user.Email); stringBuilder.Append(user.HashPassword); string input = stringBuilder.ToString(); string key = new Md5CryptoService().CalculateMd5Hash(input); var session = new SessionInfo(new UserModel(user), creatingTime) { IsLogged = true }; session.SessionKey = key; sessions.Add(key, session); return(key); }