Try our conversational search powered by Generative AI!

Users are not correctly logged out

Hello, we are having issues with the login/logout procedures. Given this case: - User logs in - User changes her/his username - The label which displays the username displays the old username (this might be normal i guess?) - User logs out - User can now log in with both new and old username but there is only one row in tblUsers. AND the label showing the currently logged in user is wrong. This is the logout code: UnifiedPrincipal user = UnifiedPrincipal.Current; if (user.Identity.IsAuthenticated) { if (Configuration.Authentication != AuthenticationMode.Forms) return; FormsAuthentication.SignOut(); UnifiedPrincipal.RemoveFromCache( user.Identity ); PageBase.CurrentUser = UnifiedPrincipal.AnonymousUser;
May 15, 2007 16:07
You may find these technical notes interesting: and the web.config setting: EPnUserCacheTimeout Timeout limit, in minutes, to keep the user's principal information described in this technical note:
May 15, 2007 16:37
Hello, this value, wheter is 0 or 10 doesn't seem to affect the behaviour.
May 15, 2007 17:11
Hi Shamrez! Try to drop the UserSid from its cache as well as the UnifiedPrincipal. Extranet accounts are authenticated by (trying) to load the UserSid by name (from database), then create a Principal from it and then lastly validate password and ipaddresses and such. When a Sid once has been loaded, it will be put in the UserSid cache and remain there forever, there simply is no way of specifying a cache timeout for those objects. You can use the function Sid.ClearCache() to remove the sid. Something like this might work: UserSid sid = UserSid.Load( UnifiedPrincipal.CurrentSid ); Sid.ClearCache(sid); Regards, Johan Olofsson EPiServer AB
May 16, 2007 12:21
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.