-
Notifications
You must be signed in to change notification settings - Fork 0
Recipes
Muhammet Şafak edited this page Jun 10, 2026
·
1 revision
Practical, copy-pasteable patterns built on top of the public API. Each recipe is self-contained and links back into the reference material for the methods it uses.
| Recipe | Solves |
|---|---|
| Remember Me | A long-lived signed login token — store an opaque selector/validator in the cookie, keep authority server-side. |
| Flash Messages | One-time post-redirect messages using pull() and a short per-key TTL. |
| Consent Cookie | A long-lived cookie-consent / preference flag that gates analytics and supports withdrawal. |
If you have built something on top of the package that other users might benefit from, please open an issue with a sketch — recipe contributions are welcomed.
Every recipe rests on the same two rules:
- The client can read the cookie. Store opaque references, never secrets. See the Security Model.
-
Nothing is written until
send(). Issue, refresh, and delete all require asend()before output. See Sending & Lifecycle.
- Quick Start — the five-minute tour the recipes build on.
- Configuration — the cookie attributes each recipe sets.
- API Reference — every method the recipes call.
initphp/cookies · MIT License · part of the InitPHP family
Source · Issues · Discussions · Packagist · Contributing · Security Policy
Getting Started
Core Usage
Reference
Practical Guides
Migration & Help