HttpRequest::addCookies

(PECL pecl_http >= 0.10.0)

HttpRequest::addCookiesAdd cookies

Descrição

public bool HttpRequest::addCookies ( array $cookies )

Add custom cookies.

Nota: The request option encodecookies controls whether the cookie values should be urlencode()d.

Nota: Affects any request method.

Parâmetros

cookies

an associative array containing any cookie name/value pairs to add

Valor Retornado

Retorna TRUE em caso de sucesso ou FALSE em caso de falha.

Exemplos

Exemplo #1 A HttpRequest::addCookies() example

<?php
$r 
= new HttpRequest;
$r->addCookies(
    array(
        
"cookie_name" => "cookie value",
    )
);
?>

Veja Também

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top