0, 'path' => defined( 'COOKIEPATH' ) && constant( 'COOKIEPATH' ) ? (string) constant( 'COOKIEPATH' ) : '/', 'domain' => defined( 'COOKIE_DOMAIN' ) && constant( 'COOKIE_DOMAIN' ) ? (string) constant( 'COOKIE_DOMAIN' ) : '', 'secure' => is_ssl(), 'httponly' => true, 'samesite' => 'Lax', ) ); $_COOKIE[ self::COOKIE ] = $value; return self::hash( $value, self::key() ); } /** * A filter result as trimmed text; anything else is ''. Filters can return any type. * * @param mixed $value Filter result. */ private static function text( $value ): string { return is_string( $value ) ? trim( $value ) : ''; } /** * Hash key, derived from the site's auth salt. */ private static function key(): string { return hash_hmac( 'sha256', 'fitzaro-visitor', wp_salt( 'auth' ) ); } }