Sessions
Annabel exposes sessions through the session() helper.
Store values
Use the session store to persist values across requests for the same client.
Flash data
Flash values when they should remain available only for the next request.
Validation uses flashed errors and old input for web redirects.
Drivers
Common session drivers include array, file, cache, Redis, Predis, Redis
Sentinel, and Redis Cluster handlers. Use a shared handler for multi-node
production deployments.
Configuration
Sessions are configured in config/session.php.
Use SESSION_DRIVER=array in isolated tests and a shared driver such as Redis
for multi-node deployments.
Cookie security
Set secure cookies in production:
Encryption
Session payload encryption is enabled when SESSION_ENCRYPTION_KEY is set.
Keep SESSION_ALLOW_PLAINTEXT=true during a migration from plaintext sessions,
then disable it after old sessions expire.
Redis sessions
Configure Redis sessions when multiple application instances need shared session state.