WP_Session_Tokens::destroy_all()

Destroys all sessions for a user.

Source

final public function destroy_all() {
	$this->destroy_all_sessions();
}

Changelog

VersionDescription
4.0.0Introduced.

User Contributed Notes

  1. Skip to note 2 content

    Following is the real world example for destroying all the sessions for a user using destroy_all().

    $user_id = get_current_user_id(); // Or you can set any value
    	$sessions = WP_Session_Tokens::get_instance( $user_id );
    	// we have got the sessions, destroy them all!
        $sessions->destroy_all();
     

You must log in before being able to contribute a note or feedback.