WordPress at a glance
function is not described

WP_Recovery_Mode_Cookie_Service::generate_cookie() private WP 5.2.0

Generates the recovery mode cookie value.

The cookie is a base64 encoded string with the following format:

recovery_mode|iat|rand|signature

Where "recovery_mode" is a constant string, iat is the time the cookie was generated at, rand is a randomly generated password that is also used as a session identifier and signature is an hmac of the preceding 3 parts.

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

No Hooks.

Return

String. Generated cookie content.

Usage

// private - for code of main (parent) class only
$result = $this->generate_cookie();

Changelog

Since 5.2.0 Introduced.

Code of WP_Recovery_Mode_Cookie_Service::generate_cookie() WP 5.5.1

<?php
private function generate_cookie() {
	$to_sign = sprintf( 'recovery_mode|%s|%s', time(), wp_generate_password( 20, false ) );
	$signed  = $this->recovery_mode_hash( $to_sign );

	return base64_encode( sprintf( '%s|%s', $to_sign, $signed ) );
}