Exemple #1
0
        public static void RemoveWebUserInfo()
        {
            var value = SessionCookieUtility.GetCookie(Constant.WebCookieKey);

            if (value.IsNotEmpty())
            {
                SessionCookieUtility.RemoveCookie(Constant.WebCookieKey);
            }
        }
Exemple #2
0
        private static WebUserContext GetWebUser()
        {
            WebUserContext webContext = null;

            try
            {
                string key = SessionCookieUtility.GetCookie(Constant.WebCookieKey).ToString();
                if (key.IsNotEmpty())
                {
                    webContext = DesEncoderAndDecoder.Decrypt(key).Deserialize <WebUserContext>();
                }
            }
            catch (Exception ex)
            {
                LogUtils.LogError("UserContext.GetWebUser", ex);
            }
            return(webContext);
        }