header() public method

Send the header
public header ( string $s, boolean $replace = true, boolean $code = false ) : boolean
$s string Header. Example: 'Location: http://php.net/'
$replace boolean Optional. Replace?
$code boolean Optional. HTTP response code
return boolean Success
Beispiel #1
0
 /**
  * Set the cookie
  * @param  string  $name     Name of cookie
  * @param  string  $value    Value
  * @param  integer $maxage   Optional. Max-Age. Default is 0.
  * @param  string  $path     Optional. Path. Default is empty string.
  * @param  string  $domain   Optional. Domain. Default is empty string.
  * @param  boolean $secure   Optional. Secure. Default is false.
  * @param  boolean $HTTPOnly Optional. HTTPOnly. Default is false.
  * @return void
  */
 public function setcookie($name, $value = '', $maxage = 0, $path = '', $domain = '', $secure = false, $HTTPOnly = false)
 {
     $this->client->header('Set-Cookie: ' . $name . '=' . rawurlencode($value) . (empty($domain) ? '' : '; Domain=' . $domain) . (empty($maxage) ? '' : '; Max-Age=' . $maxage) . (empty($path) ? '' : '; Path=' . $path) . (!$secure ? '' : '; Secure') . (!$HTTPOnly ? '' : '; HttpOnly'), false);
 }