Inheritance: extends PHPDaemon\Network\Connection, use trait PHPDaemon\Traits\DeferredEventHandlers, use trait PHPDaemon\Traits\Sessions
Example #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);
 }