HEX
Server: LiteSpeed
System: Linux dal1.hostclusters.com 5.14.0-687.26.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jul 14 16:32:02 EDT 2026 x86_64
User: vslw (1496)
PHP: 8.0.30
Disabled: NONE
Upload Files
File: /home/vslw/www/wp-content/plugins/redirection/matches/cookie.php
<?php

require_once __DIR__ . '/http-header.php';

/**
 * Check that a cookie value exists
 */
class Cookie_Match extends Header_Match {
	public function name() {
		return __( 'URL and cookie', 'redirection' );
	}

	public function is_match( $url ) {
		if ( $this->regex ) {
			$regex = new Red_Regex( $this->value, true );
			$cookie = Redirection_Request::get_cookie( $this->name );
			if ( $cookie === false ) {
				return false;
			}

			return $regex->is_match( $cookie );
		}

		return Redirection_Request::get_cookie( $this->name ) === $this->value;
	}
}