I am using FormsAuthentication for an ASP.NET site with a main page that displays the currently logged-in user, Page.User.Identity.Name.
They can change their username in their settings, and when this happens, I update their cookie for them, so they should not log out / leave messages with a postback.
FormsAuthentication.SignOut(); FormsAuthentication.SetAuthCookie(username, false);
I'm probably pretty picky, but after they changed their username, the main page still displays its original username until it reloads or another page loads.
Is there a way to programmatically update the current Page.User so that their new username is displayed during the same postback?
Adam
source share