예제 #1
0
파일: otp.php 프로젝트: DarneoStudio/bitrix
 /**
  * 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;
 }
예제 #2
0
파일: otp.php 프로젝트: rasuldev/torino
 /**
  * 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;
 }