Q:

MVC 5 Global User Account Object

I have a application with the following Layout. In the Shared Views Folder I have, _Layout.cshtml, _SideNav.cshtml and _CurrentUser.cshtml.
In the _Layout.cshtml I have: 
@{ Html.RenderPartialIf("_SideNav", Request.IsAuthenticated); }

In the _SideNav.cshtml I have: 
@{ Html.RenderPartial("_CurrentUser"); }

In the _CurrentUser.cshtml I have:
<div class="login-info">
    <span>
        <a href="javascript:void(0);" id="show-shortcut" data-action="toggleShortcut">
            <img src="~/content/img/avatars/sunny.png" alt="me" class="online" />
            <span>@User.Identity.Name</span>
            <i class="fa fa-angle-down"></i>
        </a>
    </span>
</div>

We use FormsAuthentication to authenticate a user. We are not using the standard Identity authentication which ships with ASP.Net MVC 5 because we are using a LDAP Server.
FormsAuthentication.SetAuthCookie(username, isPersistent);
.....
HttpContext.Current.User = new GenericPrincipal(new GenericIdentity(username, "Forms"), roles);

We use the username in the cookie so that we can easily get information from the LDAP server.
Problem: @User.Identity.Name returns that username. But I need to display the full name of the user. I have access to the full name when we authenticate. but not sure how to use it.
How can I pass the FullName value from the AccountController to the _CurrentUser.cshtml partial view? Kind of like a Global Container like @User.Identity with more attributes that can be set.

A:

You can use something like this
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,
                                                                viewModel.Email,
                                                                YOUR_ISSUE_DATE,
                                                                YOUR_EXPIRE_DATE,
                                                                viewModel.RememberMe,
                                                                JsonConvert.SerializeObject(user),
                                                                FormsAuthentication.FormsCookiePath);

string hash = FormsAuthentication.Encrypt(ticket);
HttpCookie authcookie = new HttpCookie(FormsAuthentication.FormsCookieName, hash);

Response.Cookies.Add(authcookie);

