PHP-HTTP
  • PHP-HTTP

HTTPlug

  • Introduction
    • Client Interfaces
    • Implementations
    • Usage
    • History
  • Usage
    • Library Users
    • Application Developers
    • Library Developers
  • Exceptions
  • Tutorial
    • Setting up the Project
    • Writing Some Simple Code
    • Using an Asynchronous Client
    • Handling Errors
  • Migrating
    • Migrating from Ivory HTTP Adapter
    • Migrating from Guzzle
  • Clients & Adapters
    • cURL Client
    • Socket Client
    • Mock Client
    • Symfony Client
    • Artax Adapter
    • Buzz Adapter
    • CakePHP Adapter
    • Guzzle5 Adapter
    • Guzzle 6 Adapter
    • Guzzle 7 Adapter
    • React Adapter
    • Zend Adapter
    • Composer Virtual Packages
  • Plugins
    • Introduction
    • Building Custom Plugins
    • Seekable Body Plugins
    • Authentication Plugin
    • Cache Plugin
    • Content-Length Plugin
    • Content-Type Plugin
    • Cookie Plugin
    • Decoder Plugin
    • Error Plugin
    • Header Plugins
    • History Plugin
    • Logger Plugin
    • Query plugin
    • Redirect Plugin
    • Request URI Manipulations
    • Retry Plugin
    • Stopwatch Plugin
    • VCR Plugin - Record and Replay Responses
  • Framework Integrations
    • Symfony Bundle
    • Full configuration
  • Backwards compatibility
    • Symfony Bundle
    • Discovery

Components

  • Message
    • Authentication
    • HTTP Factories
  • Client Common
    • HttpMethodsClient
    • BatchClient
    • PluginClient
    • HttpClientPool
    • HTTP Client Router
  • Adapter Integration Tests
  • Promise
    • Asynchronous requests
    • Wait
    • Then
  • Discovery
    • Strategies
    • Installation
    • Common Errors
    • HTTP Client Discovery
    • HTTP Asynchronous Client Discovery
    • PSR-17 Factory Discovery
    • PSR-18 Client Discovery
    • PSR-7 Message Factory Discovery
    • PSR-7 URI Factory Discovery
    • Mock Client Discovery
    • Integrating your own implementation with the discovery mechanism using Puli
  • Multipart Stream Builder
    • Building a Multipart Stream

———

  • Development
    • Contributor Code of Conduct
    • Contributing
    • Building the Documentation
    • License
 
PHP-HTTP
  • Docs »
  • Plugins »
  • Cookie Plugin
  • Edit on GitHub

Cookie PluginΒΆ

The CookiePlugin allow you to store cookies in a CookieJar and reuse them on consequent requests according to RFC 6265#section-4 specification:

use Http\Discovery\HttpClientDiscovery;
use Http\Message\CookieJar;
use Http\Client\Common\PluginClient;
use Http\Client\Common\Plugin\CookiePlugin;

$cookiePlugin = new CookiePlugin(new CookieJar());

$pluginClient = new PluginClient(
    HttpClientDiscovery::find(),
    [$cookiePlugin]
);
Next Previous

© Copyright 2015, The PHP-HTTP Team.

Sphinx theme provided by Read the Docs
Read the Docs v: latest
Versions
latest
Downloads
html
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.