WordPress at a glance
function is not described

WP_Recovery_Mode_Cookie_Service::get_session_id_from_cookie() public WP 5.2.0

Gets the session identifier from the cookie.

The cookie should be validated before calling this API.

It's a method of the class: WP_Recovery_Mode_Cookie_Service{}

No Hooks.

Return

String/WP_Error. Session ID on success, or error object on failure.

Usage

$WP_Recovery_Mode_Cookie_Service = new WP_Recovery_Mode_Cookie_Service();
$WP_Recovery_Mode_Cookie_Service->get_session_id_from_cookie( $cookie );
$cookie(string)
Optionally specify the cookie string. If omitted, it will be retrieved from the super global.
Default: ''

Changelog

Since 5.2.0 Introduced.

Code of WP_Recovery_Mode_Cookie_Service::get_session_id_from_cookie() WP 5.5.1

<?php
public function get_session_id_from_cookie( $cookie = '' ) {
	if ( ! $cookie ) {
		if ( empty( $_COOKIE[ RECOVERY_MODE_COOKIE ] ) ) {
			return new WP_Error( 'no_cookie', __( 'No cookie present.' ) );
		}

		$cookie = $_COOKIE[ RECOVERY_MODE_COOKIE ];
	}

	$parts = $this->parse_cookie( $cookie );
	if ( is_wp_error( $parts ) ) {
		return $parts;
	}

	list( , , $random ) = $parts;

	return sha1( $random );
}