79173308

Date: 2024-11-09 17:24:06
Score: 1
Natty:
Report link

The problem seems to be that Google Cloud Run doesn't support per-session files, as the service is stateless by default. Solutions include:

Switch to Redis or Firestore for Sessions: Set SESSION_DRIVER=redis (or another central store)

in .env. Redis can be configured with Google's Memorystore, or Firestore can be used with custom setups.

SESSION_DRIVER=redis
REDIS_HOST=your-redis-host
REDIS_PASSWORD=your-redis-password
REDIS_PORT=6379

Set SESSION_DRIVER=cookie: If Redis is not in place, use Cookie Sessions: store session data in encrypted cookies-should be good enough for smaller data.

Set Secure Configs: Insure SESSION_DOMAIN and SESSION_SECURE_COOKIE=true in .env if using a custom domain and HTTPS.

Check CSRF: Ensure your forms include @csrf even if CSRF is disabled on certain routes.

Flush the config and cache after modification

php artisan config:cache 
php artisan cache:clear
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @csrf
  • Low reputation (1):
Posted by: Sathish