0%

After Login Get 419 Page Expired

Sometimes after login, you will still get a 419 page expired error. This is because the server can not match the token send from the client. To avoid this error, you can use the following method:

Make sure your login form has @csrf

1
2
<form method="POST" action="{{ route('login') }}">
@csrf

Edit .env file

You can add one item to the .env file
if you are under developing, you can add this line to the .env file:

1
SESSION_DOMAIN=127.0.0.1

if you are in production, you can add this line to the .env file:

1
SESSION_DOMAIN=yourdomain.com

Clear the cache

1
php artisan cache:clear