Nette\Http\IResponse::setCookie PHP Method

setCookie() public method

Sends a cookie.
public setCookie ( $name, $value, $expire, $path = NULL, $domain = NULL, $secure = NULL, $httpOnly = NULL ) : void
return void
    function setCookie($name, $value, $expire, $path = NULL, $domain = NULL, $secure = NULL, $httpOnly = NULL);

Usage Example

Exemplo n.º 1
0
 /**
  * Sends the session cookies.
  * @return void
  */
 private function sendCookie()
 {
     if (!headers_sent() && ob_get_level() && ob_get_length()) {
         trigger_error('Possible problem: you are starting session while already having some data in output buffer. This may not work if the outputted data grows. Try starting the session earlier.', E_USER_NOTICE);
     }
     $cookie = $this->getCookieParameters();
     $this->response->setCookie(session_name(), session_id(), $cookie['lifetime'] ? $cookie['lifetime'] + time() : 0, $cookie['path'], $cookie['domain'], $cookie['secure'], $cookie['httponly'])->setCookie('nette-browser', $_SESSION['__NF']['B'], Response::BROWSER, $cookie['path'], $cookie['domain']);
 }
All Usage Examples Of Nette\Http\IResponse::setCookie