0 ? time() + $lifetime : 0; return setcookie($name, $value, [ 'expires' => $expires, 'path' => self::$path, 'domain' => self::$domain, 'secure' => self::$secure, 'httponly' => self::$httponly, 'samesite' => self::$samesite, ]); } /** * Удаляет cookie. * * @param string $name Имя * @return bool */ public static function delete(string $name): bool { unset($_COOKIE[$name]); return setcookie($name, '', [ 'expires' => 1, 'path' => self::$path, 'domain' => self::$domain, 'secure' => self::$secure, 'httponly' => self::$httponly, 'samesite' => self::$samesite, ]); } }