Пример #1
0
        public static int GetCurrentMemberUserId(bool clearNoAccessLogin = false)
        {
            HttpCookie httpCookie = HttpContext.Current.Request.Cookies.Get("Vshop-Member");
            int        result;

            if (httpCookie == null || string.IsNullOrEmpty(httpCookie.Value))
            {
                result = 0;
            }
            else
            {
                HttpCookie httpCookie2 = HttpContext.Current.Request.Cookies.Get("Vshop-Member-Verify");
                if (httpCookie2 == null || string.IsNullOrEmpty(httpCookie2.Value))
                {
                    result = 0;
                }
                else
                {
                    int num = 0;
                    if (Globals.EncryptStr(httpCookie.Value) == httpCookie2.Value)
                    {
                        int.TryParse(httpCookie.Value, out num);
                    }
                    else if (clearNoAccessLogin)
                    {
                        Globals.ClearUserCookie();
                    }
                    result = num;
                }
            }
            return(result);
        }