EBADCSRFTOKEN: Invalid CSRF token for prodution

Hello

I have the following problem:

When activating the CSRF_TOKEN protection, in localhost it works normally, however when I send the site to production. the following message appears:

HttpException: EBADCSRFTOKEN: Invalid CSRF token

Can anyone help me with this question?

2 Likes

Are you writing it in this way?


{{ csrfField() }}

Here the reference docs

@ShadowPaz thanks for answering

Yes, i do. The error continues :frowning:

Generated APP_KEY in .env ?