如果我创建一个包含五个自定义属性的自定义主体(例如,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;
}
}
}
}