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

geetpurwar's avatar

Embedding Laravel Form in iFrame shows 419 (CSRF token mismatch) Error

Hi,

I am trying to embed laravel form for submission via iframes, and its showing 419 error on all browsers.

Is it possible to submit the form using csrf and iframes? I don't want to excempt the url in verifyCSRFToken.php

Let me know. Thanks.

0 likes
1 reply
mercuryseries's avatar

You can play with the config/session.php same_site value.

For example:

'same_site' => 'none',
'secure' => env('SESSION_SECURE_COOKIE'),

with the env var SESSION_SECURE_COOKIE=true.

Please read more about same_site online to learn the security parts.

1 like

Please or to participate in this conversation.