public function __construct($secret, $algorithm)
{
$this->secret = substr($secret, 0, 32);
$this->algorithm = $algorithm;
if (!function_exists('mcrypt_module_open')) {
throw new \RuntimeException('You need to install mcrypt if you want to encrypt your cookies.');
}
$this->module = @mcrypt_module_open($this->algorithm, '', MCRYPT_MODE_CBC, '');
if ($this->module === false) {
throw new \InvalidArgumentException(sprintf("The supplied encryption algorithm '%s' is not supported by this system.", $this->algorithm));
}
$this->ivSize = mcrypt_enc_get_iv_size($this->module);
@trigger_error('Encrypted Cookie is now deprecated due to high coupling with the deprecated mcrypt extension', E_USER_NOTICE);
}