WP_User_Meta_Session_Tokens::update_session()protectedWP 4.0.0

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

Method of the class: WP_User_Meta_Session_Tokens{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->update_session( $verifier, $session );
$verifier(string) (required)
Verifier for the session to update.
$session(array)
Session. Omitting this argument destroys the session.
Default: null

Changelog

Since 4.0.0 Introduced.

WP_User_Meta_Session_Tokens::update_session() code WP 6.5.2

protected function update_session( $verifier, $session = null ) {
	$sessions = $this->get_sessions();

	if ( $session ) {
		$sessions[ $verifier ] = $session;
	} else {
		unset( $sessions[ $verifier ] );
	}

	$this->update_sessions( $sessions );
}