Beispiel #1
0
 /**
  * Store new value for skip OTP checking ("Remember OTP on this computer") in cookies
  *
  * @return $this
  */
 protected function setSkipCookie()
 {
     /** @global \CMain $APPLICATION */
     global $APPLICATION;
     $signer = new TimeSigner();
     $rememberLifetime = $this->getRememberLifetime();
     $rememberLifetime += time();
     $rememberValue = $this->getSkipCookieValue();
     $signedValue = $signer->setKey($this->getSecret())->sign($rememberValue, $rememberLifetime, 'MFA_SAVE');
     $isSecure = Option::get('main', 'use_secure_password_cookies', 'N') === 'Y' && $this->getContext()->getRequest()->isHttps();
     $APPLICATION->set_cookie(static::SKIP_COOKIE, $signedValue, $rememberLifetime, '/', false, $isSecure, true, false, true);
     return $this;
 }
Beispiel #2
0
 /**
  * Store new value for skip OTP checking ("Remember OTP on this computer") in cookies
  *
  * @return $this
  */
 protected function setSkipCookie()
 {
     /** @global \CMain $APPLICATION */
     global $APPLICATION;
     $signer = new TimeSigner();
     $rememberLifetime = $this->getRememberLifetime();
     $rememberLifetime += time();
     $rememberValue = $this->getSkipCookieValue();
     $signedValue = $signer->setKey($this->getSecret())->sign($rememberValue, $rememberLifetime, 'MFA_SAVE');
     $APPLICATION->set_cookie(static::SKIP_COOKIE, $signedValue, $rememberLifetime, '/', false, false, true, false, true);
     return $this;
 }