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

luisorguzman's avatar

I'm getting the message “The page has expired due to inactivity” in Laravel 5.5

When I run the project locally, everything works perfect. But when I deploy the project in production, I get the message "The page has expired due to inactivity" every time I submit a form with POST mnethod.

There are many questions about this problem and I've tried every possible solution:

1- My form contains the token {{ csrf_field() }} 2- I've changed the name of my app (APP_NAME)

The session driver and the cache drive are set to 'file'.

I heard that maybe the storage file is not writable and this is where it stores session. I don't know how to check it, if my project is deployed in GCLoud (Google Cloud Platform).

Thanks

0 likes
2 replies
bashy's avatar

Yeah it normally happens when it can't write or doesn't accept the session. If you look in the HTML and find the CSRF token, if it changes upon refreshing the page (new one each time), you will get that message over and over.

storage folder needs to be writable as per the docs.

Please or to participate in this conversation.