protected bool IsUserLogedIn(IHttpRequest request)
        {
            IHttpSession session = GetCurrentSession(request);

            if (session.ContainsParameter(userInfo))
            {
                return(true);
            }
            return(false);
        }
        protected void LogOutUser(IHttpRequest request)
        {
            IHttpSession session = GetCurrentSession(request);

            if (session.ContainsParameter(userInfo))
            {
                session.ClearParameters();
                return;
            }
            throw new InvalidOperationException($"There is no loged in user at the moment!");
        }
        protected string[] GetCurrentSessionUserIdandName(IHttpRequest request)
        {
            string[]     result  = null;
            IHttpSession session = GetCurrentSession(request);

            if (session.ContainsParameter(userInfo))
            {
                result = (string[])session.GetParameter(userInfo);
            }
            return(result);
        }
        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");
        }