1// Get current logged-in user.
2$user = wp_get_current_user();
3
4// Change password.
5wp_set_password($new_password, $user->ID);
6
7// Log-in again.
8wp_set_auth_cookie($user->ID);
9wp_set_current_user($user->ID);
10do_action('wp_login', $user->user_login, $user);