Since the ClaimsPrincipal.Current
accesses the Thread.CurrentPrincipal
locally, I guess you could just update the current thread principal for the lifetime of the current request.
// your existing code
account.RemoveClaim(ClaimTypes.Gender);
account.AddClaim(ClaimTypes.Gender, newGender);
// additional code that updates current thread principal
ClaimsPrincipal principal = Thread.CurrentPrincipal as ClaimsPrincipal;
if ( principal != null ) {
ClaimsIdentity identity = principal.Identities.ElementAt(0);
identity.AddClaim( new Claim( ClaimTypes.Gender, "asdf" ) );
}
// this works now
string gender = ClaimsPrincipal.Current.Claims.GetValue( ClaimTypes.Gender );
Note that since you are reissuing the cookie, the next request should correctly pick up your changes.