wp_destroy_current_session

Remove the current session token from the database.

Description

wp_destroy_current_session(); 

Usage

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

Defined (1)

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

/wp-includes/user.php  
  1. function wp_destroy_current_session() { 
  2. $token = wp_get_session_token(); 
  3. if ( $token ) { 
  4. $manager = WP_Session_Tokens::get_instance( get_current_user_id() ); 
  5. $manager->destroy( $token );