|
Size: | 8600 |
Storage flags: | no_autoload,compress/gzip (33%) |
Zend\Session\Validator\HttpUserAgent provides a validator to check the session against the originally stored $_SERVER[‘HTTP_USER_AGENT’] variable. Validation will fail in the event that this does not match and throws an exception in Zend\Session\SessionManager after session_start() has been called.
A basic example is one like the following:
1 2 3 4 5 | use Zend\Session\Validator\HttpUserAgent;
use Zend\Session\SessionManager;
$manager = new SessionManager();
$manager->getValidatorChain()->attach('session.validate', array(new HttpUserAgent(), 'isValid'));
|
The source code of this file is hosted on GitHub. Everyone can update and fix errors in this document with few clicks - no downloads needed.