public ActionResult ChangeUsername()
        {
            string userName = "";
            int    userID   = 0;

            HttpCookie authCookie = Request.Cookies["Cookie1"];

            if (authCookie != null)
            {
                FormsAuthenticationTicket authTicket = FormsAuthentication.Decrypt(authCookie.Value);

                var serializeModel = JsonConvert.DeserializeObject <CustomSerializeModel>(authTicket.UserData);

                userName = serializeModel.UserName;
                userID   = serializeModel.UserId;
            }

            ChangeUserNameViewModel model = new ChangeUserNameViewModel();

            model.userID          = userID;
            model.CurrentUserName = userName;

            Debug.WriteLine(model.userID);

            return(View(model));
        }
        public async Task <ActionResult> ChangeUsername(ChangeUserNameViewModel model)
        {
            //TODO: Add Password authentication.

            Debug.WriteLine(model.userID);

            User user = await db.Users.FindAsync(model.userID);

            user.UserName = model.NewUserName;

            await db.SaveChangesAsync();

            return(LogOut());
        }