내가 사용자를 로그인 할 WebSecurity 및 SimpleMembershipProvider을 사용하고 있습니다.사용자가 이메일을 변경 한 것을 반영하도록 쿠키를 새로 고침하려면 어떻게해야합니까?
사용자를 자신의 이메일이 업데이트 후
Dim memberId As Integer = 1
Dim context As UsersContext = New UsersContext
Dim userProfile As UserProfile =
context.UserProfiles.Where(Function(f) f.UserId = memberId).SingleOrDefault()
' Email before the change: "[email protected]"
userProfile.UserName = "[email protected]"
context.SaveChanges()
을 변경할 수 있습니다, 그러나, HttpContext를 여전히 그들의 오래된 이메일과 같은 사용자를보고합니다. 처음에는
' Name is "[email protected]" but should be "[email protected]"
HttpContext.User.Identity.Name
는 내가 자신의 로그인 정보를 변경하는 사용자를 반영하기 위해 어떻게 든 인증 쿠키를 새로 고칠 수 있습니다 어떻게 그냥
WebSecurity.Logout()
' but I don't have the user's password
WebSecurity.Login("[email protected]", "???")
에서 다시 사용자가 로그인 할 수 있다고 생각?
로그 아웃하고 새로운 사용자 이름으로 다시 로그인하십시오. –
하지만 저는'WebSecurity'를 사용하고 있습니다.'Login' 메소드는 사용자 이름과 패스워드가 전달되어야합니다. 어떤 아이디어? –
yick. 당신이 암호없이 그것을 할 수 없다면, 그것의 gona가 더러워 져라 ... 그것에 생각할 것이다 ... –