Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
Zend_Session_Validator_HttpUserAgent Class Reference
Inheritance diagram for Zend_Session_Validator_HttpUserAgent:
Zend_Session_Validator_Abstract Zend_Session_Validator_Interface

Public Member Functions

 setup ()
 
 validate ()
 

Additional Inherited Members

- Protected Member Functions inherited from Zend_Session_Validator_Abstract
 setValidData ($data)
 
 getValidData ()
 

Detailed Description

Definition at line 37 of file HttpUserAgent.php.

Member Function Documentation

◆ setup()

setup ( )

Setup() - this method will get the current user agent and store it in the session as 'valid data'

Returns
void

Implements Zend_Session_Validator_Interface.

Definition at line 46 of file HttpUserAgent.php.

47  {
48  $this->setValidData( (isset($_SERVER['HTTP_USER_AGENT'])
49  ? $_SERVER['HTTP_USER_AGENT'] : null) );
50  }

◆ validate()

validate ( )

Validate() - this method will determine if the current user agent matches the user agent we stored when we initialized this variable.

Returns
bool

Implements Zend_Session_Validator_Interface.

Definition at line 58 of file HttpUserAgent.php.

59  {
60  $currentBrowser = (isset($_SERVER['HTTP_USER_AGENT'])
61  ? $_SERVER['HTTP_USER_AGENT'] : null);
62 
63  return $currentBrowser === $this->getValidData();
64  }

The documentation for this class was generated from the following file: