WP_Session_Tokens::verify()publicWP 4.0.0

Validates the given session token for authenticity and validity.

Checks that the given token is present and hasn't expired.

Method of the class: WP_Session_Tokens{}

No Hooks.

Return

true|false. Whether the token is valid for the user.

Usage

$WP_Session_Tokens = new WP_Session_Tokens();
$WP_Session_Tokens->verify( $token );
$token(string) (required)
Token to verify.

Changelog

Since 4.0.0 Introduced.

WP_Session_Tokens::verify() code WP 6.4.3

final public function verify( $token ) {
	$verifier = $this->hash_token( $token );
	return (bool) $this->get_session( $verifier );
}