WireHttp::setCookie() method

Set cookie(s) for http GET/POST/etc. request (currently used by curl option only)

Available since version 3.0.199.

Example

$http->setCookie('PHPSESSID', 'f3943z12339jz93j39iafai3f9393g');
$http->post('http://domain.com', [ 'foo' => 'bar' ], [ 'use' => 'curl' ]);

Usage

$self = $http->setCookie(string $name, $value);

Arguments

NameType(s)Description
$namestring

Name of cookie to set

$valuestring int null

Specify value to set or null to remove

Return value

self


$http methods and properties

API reference based on ProcessWire core version 3.0.251