WP_Session_Tokens::destroy_others() WordPress Method

The destroy_others() method of the WP_Session_Tokens class destroys all session tokens for the current user except the one that is currently active.

WP_Session_Tokens::destroy_others( string $token_to_keep ) #

Destroys all sessions for this user except the one with the given token (presumably the one in use).


Parameters

$token_to_keep

(string)(Required)Session token to keep.


Top ↑

Source

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

	final public function destroy_others( $token_to_keep ) {
		$verifier = $this->hash_token( $token_to_keep );
		$session  = $this->get_session( $verifier );
		if ( $session ) {
			$this->destroy_other_sessions( $verifier );
		} else {
			$this->destroy_all_sessions();
		}
	}


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.