/// <summary>
        /// Creates a new forms authentication ticket for the logged in user and store it in the response http cookies.
        /// </summary>
        /// <param name="principal"></param>
        public static void SetFormsAuthenticationTicketFromLoginUser(UserAccountModel useraccount)
        {
            var json = useraccount.SerializeObject <UserAccountModel>(); //user.SerializeObject<PmcsUser>();

            FormsAuthentication.SetAuthCookie(useraccount.UserName, false);
            var ticket          = new FormsAuthenticationTicket(1, useraccount.UserName, DateTime.Now, DateTime.Now.AddMinutes(60), false, json);
            var encryptedTicket = FormsAuthentication.Encrypt(ticket);
            var authCookie      = new HttpCookie(FormsAuthentication.FormsCookieName, encryptedTicket);

            HttpContext.Current.Response.Cookies.Add(authCookie);
        }