Session
Session and cookie property injection.
Purpose & processing
Resolves the value from the APPNETOS session controller.
Parameters
| Parameter | Type | Default | Behavior |
|---|---|---|---|
| key | string | Required | Key used to resolve the value. |
Example
#[Session('theme')]
protected mixed $theme = null;
#[SessionString('theme')]
protected string $themeName = '';
Behavior and considerations
- Variants:
Session,SessionString,SessionInt,SessionFloat,SessionBool,SessionArray. - 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/Session*.php