I have no working example, only hints for thinking about this topic. The function to set a new password via the function of the core is right. But if you are using this function on the user update page, then the user will be automatically getsautomatic get logged out as it is deleting the cache of the logged in user-in users.
After the logout, can you hook in wp
and create a new login. You must do this, before anything is sendsent via 'headers'.
`add_action( 'wp', 'your_login' );`
Also think about the cookie of the login - wp_set_auth_cookie
! Also you can delete the current cache for the user - wp_cache_delete()
.
Maybe this question and his answers helpshelp you, the same topic.