Description
File: System/Helpers/cookie_helper.php
function set_cookie($name, string $value = '', string $expire = '', string $domain = '', string $path = '/', string $prefix = '', bool $secure = false, bool $httpOnly = false)
{
// The following line shows as a syntax error in NetBeans IDE
//(\Config\Services::response())->setcookie
$response = \Config\Services::response();
$response->setcookie($name, $value, $expire, $domain, $path, $prefix, $secure, $httpOnly);
// Add
$response->sendCookies(); // public
}
File:/System/HTTP/Response.php
public function setCookie( .....) {
.....
$this->cookies[] = [
'name' => $prefix.$name,
'value' => $value,
'expires' => $expire,
'path' => $path,
'domain' => $domain,
'secure' => $secure,
'httponly' => $httponly,
];
return $this; // GO sendCookies()
}
Activity