WP_Recovery_Mode_Cookie_Service::parse_cookie

Advertisement

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

Parses the cookie into its four parts.

Syntax Syntax

WP_Recovery_Mode_Cookie_Service::parse_cookie( string $cookie )

Parameters Parameters

$cookie

(string) (Required) Cookie content.

Return Return

(array|WP_Error) Cookie parts array, or error object on failure.

Source Source

File: wp-includes/class-wp-recovery-mode-cookie-service.php

	private function parse_cookie( $cookie ) {
		$cookie = base64_decode( $cookie );
		$parts  = explode( '|', $cookie );

		if ( 4 !== count( $parts ) ) {
			return new WP_Error( 'invalid_format', __( 'Invalid cookie format.' ) );
		}

		return $parts;
	}

Advertisement

Changelog Changelog

Changelog
Version Description
5.2.0 Introduced.

Advertisement

Leave a Reply

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

What are you looking for?