WP_User_Meta_Session_Tokens::get_session() WordPress Method

The WP_User_Meta_Session_Tokens::get_session() method is used to retrieve a user's session token. This can be used to help improve security by ensuring that a user's session is only valid for one device at a time.

WP_User_Meta_Session_Tokens::get_session( string $verifier ) #

Retrieves a session based on its verifier (token hash).


Parameters

$verifier

(string)(Required)Verifier for the session to retrieve.


Top ↑

Return

(array|null) The session, or null if it does not exist


Top ↑

Source

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

	protected function get_session( $verifier ) {
		$sessions = $this->get_sessions();

		if ( isset( $sessions[ $verifier ] ) ) {
			return $sessions[ $verifier ];
		}

		return null;
	}


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.