Documentation

CookiePlugin
in package
implements Plugin

FinalYes

Handle request cookies.

Tags
author

Joel Wurtz joel.wurtz@gmail.com

Table of Contents

Interfaces

Plugin
A plugin is a middleware to transform the request and/or the response.

Properties

$cookieJar  : CookieJar
Cookie storage.

Methods

__construct()  : mixed
handleRequest()  : Promise
Handle the request and return the response coming from the next callable.
createCookie()  : Cookie|null
Creates a cookie from a string.
createValueKey()  : array{0: string, 1: ?string}
Separates key/value pair from cookie.

Properties

Methods

handleRequest()

Handle the request and return the response coming from the next callable.

public handleRequest(RequestInterface $request, callable $next, callable $first) : Promise
Parameters
$request : RequestInterface
$next : callable

Next middleware in the chain, the request is passed as the first argument

$first : callable

First middleware in the chain, used to to restart a request

Return values
Promise

Resolves a PSR-7 Response or fails with an Http\Client\Exception (The same as HttpAsyncClient)

createValueKey()

Separates key/value pair from cookie.

private createValueKey(string $part) : array{0: string, 1: ?string}
Parameters
$part : string

A single cookie value in format key=value

Return values
array{0: string, 1: ?string}

        
On this page

Search results