Private Access Private Access

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

Summery Summery

Generates the recovery mode cookie value.

Syntax Syntax


Description Description

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


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.

Return Return

(string) Generated cookie content.

Source Source

File: wp-includes/class-wp-recovery-mode-cookie-service.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 ) );


Changelog Changelog

Version Description
5.2.0 Introduced.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.