예제 #1
0
 /**
  * Set the time before which the token MUST NOT be accepted
  *
  * @param string $time
  */
 public function setNotBeforeTime($time)
 {
     $this->setClaim($this->_reservedClaims['notbefore'], Steelcode_Date_Helper::unixTime($time));
 }
예제 #2
0
 /**
  * Set a cookie
  *
  * @param string $name
  * @param string $value
  * @param bool $httpOnly
  * @param string $expires
  * @param string $path
  * @param string $domain
  */
 public function setCookie($name, $value, $httpOnly = true, $expires = '', $path = '/', $domain = '')
 {
     $expires = $expires === '' ? Steelcode_Date_Helper::UTCDate('+7 day', 'D, j M Y H:i:s e') : Steelcode_Date_Helper::UTCDate($expires, 'D, j M Y H:i:s e');
     $cookie = "{$name}={$value};Path={$path};Expires={$expires}";
     $cookie .= Steelcode_String_Helper::isNull($domain) ? '' : ";Domain={$domain}";
     $cookie .= Steelcode_Ssl_Helper::isSSL() ? ';Secure' : '';
     $cookie .= $httpOnly ? ';HttpOnly' : '';
     exit($cookie);
     //$this->setFields( 'Set-Cookie', $cookie );
 }