WP_Session_Tokens::destroy_all()

Destroys all sessions for a user.


Source Source

File: wp-includes/class-wp-session-tokens.php

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


Top ↑

Changelog Changelog

Changelog
Version Description
4.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

  1. Skip to note 1 content
    Contributed by Sajid Manzoor

    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.