phpsoftbox/cookie

There is no license information available for the latest version (dev-master) of this package.

Cookie component for the PhpSoftBox framework

Installs: 2

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/phpsoftbox/cookie

dev-master 2026-02-06 10:48 UTC

This package is auto-updated.

Last update: 2026-02-06 10:48:46 UTC


README

Компонент для работы с Cookie и Set-Cookie.

Пример

use PhpSoftBox\Cookie\CookieJar;
use PhpSoftBox\Cookie\SetCookie;

$cookies = CookieJar::fromHeader('a=1; b=2');

$setCookie = SetCookie::create('sid', 'token')
    ->withHttpOnly(true)
    ->withSecure(true);

$headers = CookieJar::toHeaders([$setCookie]);

Middleware

use PhpSoftBox\Cookie\CookieMiddleware;
use PhpSoftBox\Cookie\CookieQueue;
use PhpSoftBox\Cookie\SetCookie;

$queue = new CookieQueue();
$middleware = new CookieMiddleware($queue);

$queue->queue(SetCookie::create('token', 'abc'));