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

gurpalsingh1919's avatar

419 Sorry, your session has expired. Please refresh and try again.

EArlier it was working fine but from last 2 days I am getting this error on every post request in laravel 5.7.28.

CSRF token is working fine everytime it is changing.

0 likes
4 replies
bobbybouwmann's avatar

Are you doing any ajax requests on the background? That might refresh the CSRF-token!

bugsysha's avatar

Maybe you are using wrong middleware (web auth) on that (api) route?

gurpalsingh1919's avatar
Level 1

Thanks for you reply. Problem already has been solved. This is basically cookies domain setting actually.

Thanks

Please or to participate in this conversation.