/** * Check if the cookie domain matches the config URL. * * @param array $cookie * @return bool */ private function cookieDomainMatchesConfigUrl(array $cookie) { if (!array_key_exists('domain', $cookie)) { return true; } $setCookie = new SetCookie(); $setCookie->setDomain($cookie['domain']); return $setCookie->matchesDomain(parse_url($this->config['url'], PHP_URL_HOST)); }
public function testDoesNotMatchIp() { $cookie = new SetCookie(['Domain' => '192.168.16.']); $this->assertFalse($cookie->matchesDomain('192.168.16.121')); }