wp_destroy_all_sessions() WordPress Function

The wp_destroy_all_sessions() function is used to destroy all active sessions for a user. This function is useful for when a user needs to be logged out of all their active sessions, for example, when a user's password is changed.

wp_destroy_all_sessions() #

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


Source

File: wp-includes/user.php

function wp_destroy_all_sessions() {
	$manager = WP_Session_Tokens::get_instance( get_current_user_id() );
	$manager->destroy_all();
}


Top ↑

Changelog

Changelog
VersionDescription
4.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More