WP_Recovery_Mode_Cookie_Service::parse_cookie
Parses the cookie into its four parts.
Method of the class: WP_Recovery_Mode_Cookie_Service{}
No Hooks.
Returns
Array|WP_Error. Cookie parts array, or error object on failure.
Usage
// private - for code of main (parent) class only $result = $this->parse_cookie( $cookie );
- $cookie(string) (required)
- Cookie content.
Changelog
| Since 5.2.0 | Introduced. |
WP_Recovery_Mode_Cookie_Service::parse_cookie() WP Recovery Mode Cookie Service::parse cookie code WP 6.9.1
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;
}