I have been working through this error for days and here are the issue
My project work on localhost properly, I just uploaded it to server and this error show up! Here are some facts:
- CSRF Token are work correctly under FORM and there is nothing wrong with it as it was in localhost
- I tried many solutions either to change cookie name or SESSION_DOMAIN to .mydomain.com as it shown in this post
My Form is like
<form method="POST" action="{URL SUPPOSED TO BE PATCH}" accept-charset="UTF-8">
<input name="_method" type="hidden" value="PATCH">
<input name="_token" type="hidden" value="{Key}">
...
</form>
MY .env file
APP_NAME=name
APP_ENV=production
APP_KEY={key}
APP_DEBUG=ture
APP_URL={APP URL}
LOG_CHANNEL=stack
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE={DB NAME}
DB_USERNAME={USER NAME}
DB_PASSWORD={PASSWORD}
BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_DRIVER=sync
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
SESSION_DRIVER=file
SESSION_LIFETIME=120
SESSION_DOMAIN={.mydomain.com}
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}"
ACTIVITY_LOGGER_ENABLED = true
My Session.php file
'driver' => env('SESSION_DRIVER', 'file'),
'lifetime' => env('SESSION_LIFETIME', 120),
'expire_on_close' => false,
'encrypt' => false,
'files' => storage_path('framework/sessions'),
'connection' => env('SESSION_CONNECTION', null),
'table' => 'sessions',
'store' => env('SESSION_STORE', null),
'lottery' => [2, 100],
'cookie' => 'test',
'path' => '/',
'domain' => env('SESSION_DOMAIN', null),
'secure' => env('SESSION_SECURE_COOKIE', true),
'http_only' => true,
'same_site' => null,
ALSO, I have two projects with same error but not same version
first project which is data above is 6.20.30
Version
and second is 7.28.4