Cookie
Session and cookie property injection.
Purpose & processing
Resolves the value from the APPNETOS cookie controller; cookie names are namespaced by the controller.
Parameters
| Parameter | Type | Default | Behavior |
|---|---|---|---|
| key | string | Required | Key used to resolve the value. |
Example
#[Cookie('theme')]
protected mixed $theme = null;
#[CookieString('theme')]
protected string $themeName = '';
Behavior and considerations
- Variants:
Cookie,CookieString,CookieInt,CookieFloat,CookieBool,CookieArray. - Missing untyped values resolve to null.
- Typed missing-value defaults: String = empty string, Int = 0, Float = 0.0, Bool = false, Array = empty array.
- Use the corresponding Core controller for writes; these annotations read values.
Source
shared/src/Core/Annotation/Cookie*.php