setValidData( (isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null) ); } /** * Validate() - this method will determine if the current user agent matches the * user agent we stored when we initialized this variable. * * @return bool */ public function validate() { $currentBrowser = (isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null); return $currentBrowser === $this->getValidData(); } }