CSRF Protection
Overview
When CSRF Configuration is Needed
CSRF with Cloudflare
Configure Trusted Proxies
Step 1: Get Cloudflare IP Ranges
Step 2: Update .env File
Step 3: Clear Cache
Configure Trusted Hosts
Disabling CSRF Protection
For Development Only
Production Warning
Reverse Proxy Configuration
NGINX Reverse Proxy
NGINX Configuration
PteroCA Configuration
Load Balancer
Troubleshooting
"Invalid CSRF Token" Errors
Sessions Not Persisting
Trusted Host Errors
Security Best Practices
Production Environment
Regular Maintenance
Advanced Configuration
Custom CSRF Token TTL
Per-Environment Configuration
Related Guides
Last updated