Cookie Management
The documentation is constantly evolving and updated alongside the project's progress. Since it is developed in parallel with the code, some sections may temporarily refer to earlier versions of the system-these are gradually adapted to the current state of the application. If you notice any outdated information, please report it or open an Issue / Pull Request.
Documentation
# Cookie Management
# Overview
The CookieManager provides a simple interface for working with cookies.
# Basic Usage
use Dbm\Infrastructure\Cookie\CookieManager;
$cookie = new CookieManager();
# Set Cookie
$cookie->setCookie('token', 'abc123');
# Options
setCookie(
string $name,
string $value,
int $expiry = 86400,
bool $secure = true,
bool $httpOnly = true
)
# Get Cookie
$value = $cookie->getCookie('token');
# Delete Cookie
$cookie->unsetCookie('token');
# Security
secure = true→ send only over HTTPShttpOnly = true→ not accessible via JS
# Best Practices
- Always use
securein production - Use
httpOnlyfor sensitive data. Deletion currently sends an expired cookie withsecureandhttpOnlyset totrue. - Avoid storing sensitive info in cookies
Documentation List
01. GETTING STARTED
02. CORE CONCEPTS
03. HTTP AND ROUTING
04. DATA
05. VALIDATION
06. INFRASTRUCTURE
07. SECURITY
08. PRESENTATION
09. LOCALIZATION
10. RUNTIME
11. MODULES
12. PLATFORM LIBRARIES