wp_destroy_all_sessions

Remove all session tokens for the current user from the database.

Description

wp_destroy_all_sessions(); 

Usage

  1. if ( !function_exists( 'wp_destroy_all_sessions' ) ) { 
  2. require_once ABSPATH . WPINC . '/user.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wp_destroy_all_sessions(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/user.php  
  1. function wp_destroy_all_sessions() { 
  2. $manager = WP_Session_Tokens::get_instance( get_current_user_id() ); 
  3. $manager->destroy_all();