lundi 21 décembre 2015

Wordpress wp_set_current_user not working

I am using Ultimate member plugin in WORDPRESS. And the plugin has functionality to switch user account on FRONT END, By clicking on the Login as this User but suddenly it stopped working, and Its not working.

I found the code in the files that it is ultimately using:

wp_set_current_user($user_id);
wp_set_auth_cookie($user_id, $rememberme );
// echo get_current user_id(); 
// here i am getting new user id;
$redirect_to = 'some url';
wp_safe_redirect( $redirect_to );
exit();

But after redirect i am not being switched to the new user but before redirection it returns new user id.

As i am not using any cache.

Thanks in Advance.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire