Tuesday, 1 September 2015

How to Destroy a User Session in WordPress

Source : How to Destroy a User Session in WordPress
Published On : September 01, 2015 at 07:31PM
By : Agbonghama Collins

Below is a PHP function that can programmatically logout or destroy a user session in WordPress taking the user ID as an argument. /** * Destroy the session of a user. * * @param int $user_id */ function pp_destroy_user_session( $user_id ) { // get all sessions for user with ID $user_id $sessions = WP_Session_Tokens::get_instance( $user_id […]


For More Go to : w3guy - Diary of a Geek

Labels:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home