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

successdav's avatar

The page has expired due to inactivity.

I have read a lot of articles and have tried a lot of options but none is working.

I got a new machine, install homestead and laravel, pull my project from github, I run npm install, then composer install, then composer update and npm update, it later shows they are some vulnerabilities with my project so I run npm audit fix --force.

created my .env file, configured my database then I run php artisan key:generate followed by php artisan migrate and the migrate went smoothly without errors. Open the project on the browser and it loads fine but when I try to login it keeps showing this error

The page has expired due to inactivity.

Please refresh and try again.

I have verified and the @csrf token is in place, I have run all of the cache:clear, view:clear, route:clear, composer dump-autoload but none is working.

none of the forms are even working, login, register, comments, none of them are working.

0 likes
13 replies
Cronix's avatar

I assume you are using the default file session driver? Are session files being created in /storage/framework/sessions?

When you say the forms aren't working, do you just mean when you submit, or are there other issues? Are they visually ok?

successdav's avatar

@mahaveer @cronix I have followed the link and have tried all of the solutions none is working.

@cronix the program generate session files stored on storage/framework/sessions and the form displays correction, they is nothing wrong with the view, the error shows up only when I try to submit. and it was not like this when I pushed to github, everything was fine until I git clone from git home, run composer install, composer update and & npm install.

HERE IS MY .env file

APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:ml13JDTO5637p0jDOS0hTCETUE5fPZkx8R6eS7KT/ZQ=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=success
DB_USERNAME=homestead
DB_PASSWORD=secret

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=9cc551d5e49890
MAIL_PASSWORD=3682dd5ccbc0cf
MAIL_ENCRYPTION=null

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-zz1
AWS_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

AND on the config Session.php I have

*/

    'domain' => env('SESSION_DOMAIN', null),

    /*
munazzil's avatar

Try with below commands,

    composer update --no-scripts      

and have you set config\app.php as like below,

   'debug' => env('APP_DEBUG', true),

and check your config\session.php too

successdav's avatar

@munazzil I have updated the files but still same error. but on chrome network console here is the request headers. it returns 419.

Request URL: http://stechmax.test/login Request Method: POST Status Code: 419 unknown status Remote Address: 192.168.10.10:80 Referrer Policy: no-referrer-when-downgrade

successdav's avatar

Thank you? please which solution actually worked for you?

mcstepp's avatar

Is your session signed with your old key? Can you invalidate your session (are you always remembered?)

munazzil's avatar

Have you include this in your home.blade.php?

   <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>

and run below commands as well,

   npm run dev
   npm run watch
Snapey's avatar

clear your browser cookies or try incognito mode?

siangboon's avatar

I think I will remove the entire node_modules folder and rerun npm install if no customization on any module...

successdav's avatar
successdav
OP
Best Answer
Level 4

Hello Everyone, Thanks all for your time. The problem was from the upgrade, when I run composer update, it updated my laravel from 5.6 to 5.6.30. After googling the 419 status code, it landed me on this page https://laravel.com/docs/5.6/upgrade and all I needed to do was to add this line of code to

protected static $serialize = true;

And this error has been fixed. now am unto the next error, the composer update just messed up my project leaving me with series of bugs. Once again thanks.

Please or to participate in this conversation.