Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

sagar9637's avatar

laravel application csrf token giving 419 when using docker how to solve

I'm working on a Laravel application that I'm running locally using Docker. The application loads, but I'm facing an issue with the CAPTCHA and login.

When I try to access a page with a CAPTCHA, it fails to generate.

In the browser’s Network tab, I see a 419 Page Expired error.

If I manually bypass the CSRF token (not ideal), the CAPTCHA appears — but I still can’t log in to the application.

I suspect the issue is related to CSRF tokens and session handling in Docker.

Docker Compose for local setup

Nginx as reverse proxy inside Docker

0 likes
1 reply
jlrdw's avatar

Have you tested session by setting something and retrieving it on another page?

Please or to participate in this conversation.