WP_Session_Tokens::destroy_others

Advertisement

Summery Summery

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

Syntax Syntax

WP_Session_Tokens::destroy_others( string $token_to_keep )

Parameters Parameters

$token_to_keep

(Required) Session token to keep.

Source 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();
		}
	}

Advertisement

Changelog Changelog

Changelog
Version Description
4.0.0 Introduced.

Advertisement

Leave a Reply