PHP 8.4.0 RC4 available for testing

SoapClient::__setCookie

(PHP 5 >= 5.0.4, PHP 7, PHP 8)

SoapClient::__setCookieDéfinit un cookie pour les requêtes SOAP

Description

public SoapClient::__setCookie(string $name, ?string $value = null): void

Définit le cookie qui sera envoyé avec la requête SOAP.

Note:

L'appel à cette méthode affectera tous les appels suivants aux méthodes SoapClient.

Liste de paramètres

name

Le nom du cookie.

value

La valeur du cookie. Si non spécifié, le cookie sera effacé.

Valeurs de retour

Aucune valeur n'est retournée.

Historique

Version Description
8.0.0 value is now nullable.
add a note

User Contributed Notes 2 notes

up
12
Jaygiri Goswami
12 years ago
You can access the cookies sent by SOAP server using $client->_cookies

Most you need to send session cookies back to server.
up
0
lukasz at szostak dot biz
18 years ago
On the server side you can access the cookie via $_COOKIE['cookie_name'].

Also remember that since HTTP is a stateless protocol, you have to send the cookie with every single SOAP call in order for it to be visible at server site.

It seems obvious but might save one a lot of time.
To Top