Laravel 5.4 (1/1) Tokenmismatchexception

Asked

Viewed 179 times

0

Locally all forms work, but when I put online is giving erro as if I didn’t have the _token attributed to forms.

APP_NAME=MonkStudio
APP_ENV=production
APP_KEY=base64:KV/4jmhU507Kse+PSbsBJPUwKd1vG2bFsLmN0lDCQoQ=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://monkstudio.net

.
.
.

BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync

The files are being recorded, how to resolve?

Link: http://monkstudio.net/

1 answer

1


Your application is not creating session/cookie in the browser.

inserir a descrição da imagem aqui

This prevents you from validating the token. I can’t explain the exact reason but it has happened to me.

To resolve this, you need to point the correct URL within the .env of the application on the server.

Also check the type of SESSION which is assigned in .env, if it’s file, need to have write permissions in the directory storage/sessions. If it is database needs to have session Migrations.

Read about this here

  • APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:xLjupiwxDrKRHrUseKw315QmXxWX64T4lb8WrT+GveA=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://monkstudio.net

  • Delete your previous comment, don’t pass your APP_KEY to anyone. Put it like this APP_URL=http://monkstudio.net

  • Check out the SESSION_DRIVER=file and don’t forget to check the directory permissions.

  • Sessions are being recorded but do not appear in the browser. BROADCAST_DRIVER=log CACHE_DRIVER=file SESSION_DRIVER=file QUEUE_DRIVER=Sync

  • Do a test there in config/Session.php setting there session forcibly.

  • wheel also a php artisan config:clear

  • Dude, I ran some commands here, php Artisan key:generate , php Artisan config:cache , php Artisan auth:clear-resets and it worked again. Thank you for your attention

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.