Example #1
0
        public ActionResult ShowProfile()
        {
            User user = null;

            if (CurrentCookieTester.CookieIsExist(CookieKeys.signedUserToken))
            {
                user = userManager.GetUserForCookie(CurrentCookieTester.GetCurrentToken(CookieKeys.signedUserToken));
            }
            CurrentCookieTester.SetCookie(CookieKeys.updateableUrl, "User/ShowProfile");
            return(View(user));
        }
Example #2
0
        public string GetCurrentUsername()
        {
            string      resultMain;
            UserManager usm = new UserManager();

            if (CurrentCookieTester.CookieIsExist(CookieKeys.signedUserToken) == true)
            {
                resultMain = usm.CheckCookieThenGetResponse(CurrentCookieTester.GetCurrentToken(CookieKeys.signedUserToken));
                if (resultMain == null)
                {
                    CurrentCookieTester.ExpireCookie(CookieKeys.signedUserToken, 6);
                }
            }
            else
            {
                DefaultCommon defaultCommon = new DefaultCommon();
                resultMain = DefaultCommon.UserName;
            }

            return(resultMain);
        }