Retrieve the current session token from the logged_in cookie.

Signature

wp_get_session_token()

Return

(string) Token.

Source

function wp_get_session_token() {
	$cookie = wp_parse_auth_cookie( '', 'logged_in' );
	return ! empty( $cookie['token'] ) ? $cookie['token'] : '';
}
WP Trac GitHub

Link here