DEV Community

Pradeep Kumar
Pradeep Kumar

Posted on

Laravel error 419 session expired - Fixes

If you're getting Laravel Error: 419 session expired, try the following solutions:

1. CSRF token verification failure

Try using CSRF token in your form, read more at: https://laravel.com/docs/10.x/csrf#preventing-csrf-requests

2. Session expired error due to cache

Run:

php artisan cache:clear
Enter fullscreen mode Exit fullscreen mode

And try again

3. Laravel file and folder permissions

Change folder permission to:

chmod -R 755 storage

chmod -R 755 vendor

chmod -R 644 bootstrap/caches
Enter fullscreen mode Exit fullscreen mode

4. Laravel session setting

Update following env values:

'domain' => env('SESSION_DOMAIN', null),
'secure' => env('SESSION_SECURE_COOKIE', false), // in case of cookie
Enter fullscreen mode Exit fullscreen mode

5. Update APP_HOST

APP_HOST=localhost
Enter fullscreen mode Exit fullscreen mode

Top comments (0)