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

BilalHaidar's avatar

419 Page Expired

Hi I am facing a 419 Page Expired problem. I've tried many solutions out there without any luck. I cleared all cache items, I've changed the session_driver and still the same problem.

Any idea where I should be looking?

The problem happens when submitting the login form. The @csrf exists. The Login page hosts a LoginView written in Vue.js and passes as a slot the @csrf token. The token is correctly generated and I can see it inside DevTools.

I am using Laravel 6.

Thank you Bilal

0 likes
18 replies
MichalOravec's avatar

What do you have in config/session.php under key same_site?

Set it to the lax

'same_site' => 'lax'
BilalHaidar's avatar

Hey, I don't even see this key there! Shall I add it with a value of 'lax'?

BilalHaidar's avatar

That didn't help much. I am still getting the same issue.

martinbean's avatar

@bilalhaidar It has nothing to do with the same_site config setting.

419 is a HTTP error when the CSRF token is not present in the request, or has a stale value. If you’re using Vue, Laravel should automatically include the CSRF token by parsing it from your HTML page’s meta tag. So check that the page that has the JavaScript, also has the following meta tag:

<meta name="csrf-token" value="{{ csrf_token() }}" />
BilalHaidar's avatar

Hi @martinbean Indeed I have the meta tag. I was also using the @csrf inside the Login as follows:

<LoginView ...>
  {{ csrf_field() }}
</LoginView>

For some reason, I am still facing the same issue.

sidneygijzen's avatar

What is the value of SESSION_SECURE_COOKIE in your .env file? It can also be set in config/session.php. If this is set to true, then you must login via a HTTPS url. Otherwise you get a 419 as well.

BilalHaidar's avatar

Hi @sidneygijzen Still the same issue. Everything was working a few days ago and I haven't touched the code since then!

BilalHaidar's avatar

Thanks @michaloravec

I am using Chrome. I also tried on Safari same issue.

This is happening with my current setup using Docker. I am not sure if there should be any special handling for laravel hosted on Docker. Although it was working fine on Friday. Suddenly, it stopped working!

Snapey's avatar

using apache?

If so, check that your browser is receiving session cookie.

you can see these in your browser dev tools. Clear the cookies that are there then refresh the page

If you dont see any cookie being sent then you need to check all files that you have edited since it last worked. Somewhere you will have a php file where <?php are not exactly the first characters

BilalHaidar's avatar

Hi @snapey I see cookies related to _gid, _ga, etc. I don't see a cookie set for the authentication.

BTW the AuthenticationSession middleware is commented out for some reason. Is that ok?

Snapey's avatar

Are you on apache?

If you dont see any cookie being sent then you need to check all files that you have edited since it last worked. Somewhere you will have a php file where <?php are not exactly the first characters

BilalHaidar's avatar

I am running nginx, php, etc on docker using a MacBook pro as a host

Snapey's avatar

afaik nginx does not have the same issue

Please or to participate in this conversation.