ASP.NET Custom Pricipal и Cookies (билеты) - PullRequest
       36

ASP.NET Custom Pricipal и Cookies (билеты)

0 голосов
/ 14 сентября 2011

Если я создаю пользовательский принципал с пятью пользовательскими свойствами (например, phoneNumber), данные принципала передаются внутри файла cookie или данные остаются на сервере?

void MvcApplication_AuthenticateRequest(object sender, EventArgs e)
    {
        if (HttpContext.Current.User != null)
        {
            if (HttpContext.Current.User.Identity.IsAuthenticated)
            {
                if (HttpContext.Current.User.Identity is FormsIdentity)
                {
                    // Get Forms Identity From Current User 
                    FormsIdentity id = (FormsIdentity)HttpContext.Current.User.Identity;
                    // Get Forms Ticket From Identity object 
                    FormsAuthenticationTicket ticket = id.Ticket;
                    // Create a new Generic Principal Instance and assign to Current User 
                    IFGPrincipal siteUser = new IFGPrincipal(Context.User.Identity, new string[] { }, 2);

                    HttpContext.Current.User = siteUser;
                }
            }
        } 

    }
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...