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;
You may find these technical notes interesting:
http://www.episerver.com/en/EPiServer_Knowledge_Center/Documentation/TechNotes/Configurable-Authentication-Provider-Chain/
and the web.config setting:
EPnUserCacheTimeout
Timeout limit, in minutes, to keep the user's principal information
described in this technical note:
http://www.episerver.com/en/EPiServer_Knowledge_Center/Documentation/TechNotes/webconfig-Settings/
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