コード例 #1
0
        public ProExpController(IProExpService proExpService)
        {
            _proExpService = proExpService;

            if (System.Web.HttpContext.Current.Request.Cookies[".ASPXAUTH"] != null)
            {
                FormsAuthenticationTicket ticket = null;
                var toDecrypt = System.Web.HttpContext.Current.Request.Cookies[".ASPXAUTH"].Value;
                if (toDecrypt != null)
                {
                    try
                    {
                        ticket = FormsAuthentication.Decrypt(toDecrypt);
                    }
                    catch (Exception e)
                    {
                        Console.Write(e.Message);
                    }

                    if (ticket != null)
                    {
                        _userModel = JsonConvert.DeserializeObject <ProfileModel>(ticket.UserData);
                    }
                }
            }
        }