I have a problem in my site made in laravel, the following happens my application in laravel is not returning the Session Token that would be {{ csrf_token() }}
when I perform an action like registering or logging the same I return the following error:
Thiserrorhappensonlyontheproductionserver,tryingtosolveitIendedupidentifyingthatwhenIamaccessingthesiteontheproductionservertheclientdoesnotreceivethesessiontokenthatshouldbeincookiesasintheimagesbelow:
SessionTokeninDevelopment: Sessionsessiontoken: As it turned out, it is as if the application does not return the session token on the production server, even though a token is sent in the request that is different from the one generated by the application and generates the error I reported above.
Below my session settings in the .env SESSION_DRIVER=file
My session.php
<?php
return [
'driver' => env('SESSION_DRIVER', 'file'),
'lifetime' => 120,
'expire_on_close' => false,
'encrypt' => false,
'files' => storage_path('framework/sessions'),
'connection' => null,
'table' => 'sessions',
'lottery' => [2, 100],
'cookie' => 'laravel_session',
'path' => '/',
'domain' => null,
'secure' => false,
];
If someone has already experienced this or knows something about it that can help.
Thank you in advance for your attention.