WordPress at a glance
function is not described

WP_Recovery_Mode_Cookie_Service::set_cookie() public WP 5.2.0

Sets the recovery mode cookie.

This must be immediately followed by exiting the request.

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

Hooks from the method
Return

Null. Nothing.

Usage

$WP_Recovery_Mode_Cookie_Service = new WP_Recovery_Mode_Cookie_Service();
$WP_Recovery_Mode_Cookie_Service->set_cookie();

Changelog

Since 5.2.0 Introduced.

Code of WP_Recovery_Mode_Cookie_Service::set_cookie() WP 5.5.2

<?php
public function set_cookie() {

	$value = $this->generate_cookie();

	/**
	 * Filter the length of time a Recovery Mode cookie is valid for.
	 *
	 * @since 5.2.0
	 *
	 * @param int $length Length in seconds.
	 */
	$length = apply_filters( 'recovery_mode_cookie_length', WEEK_IN_SECONDS );
	$expire = time() + $length;

	setcookie( RECOVERY_MODE_COOKIE, $value, $expire, COOKIEPATH, COOKIE_DOMAIN, is_ssl(), true );

	if ( COOKIEPATH !== SITECOOKIEPATH ) {
		setcookie( RECOVERY_MODE_COOKIE, $value, $expire, SITECOOKIEPATH, COOKIE_DOMAIN, is_ssl(), true );
	}
}