protected void LogInUser(IHttpRequest request, string userId, string userName) { IHttpSession session = GetCurrentSession(request); if (!session.ContainsParameter(userInfo)) { string[] userIdNameArray = { userId, userName }; session.AddParameter(userInfo, userIdNameArray); return; } throw new InvalidOperationException($"User {GetCurrentSessionUserIdandName(request)[1]} is already loged in! Log out First"); }