I've created a from on which a user can update there EMAIL and UserName.
After updating UserName, the user is logged out.
I'm trying to keep the user logged in.
right after the update user code I have this code which doesn't seem to do the job:
// login user
UserInfo uiNew = UserInfoProvider.GetUserInfo(newUserName);
// Set authentication cookie
FormsAuthentication.SetAuthCookie(uiNew.UserName, false);
// Set context values
CurrentUserInfo cui = new CurrentUserInfo(uiNew, true);
CMSContext.SetCurrentUser(cui);
CultureHelper.SetPreferredUICulture(cui.PreferredUICultureCode);
this is waht happens on teh form:
1) user enters new UserName
2) clicks SAVE
3) page is reloaded adn seems the user is still logged in
4) try to go to other pages on site adn LOGIN popup shows, as if
user is not logeed in any more.
ANy idea how to solve this isseu?
Thanks