Answer the question
In order to leave comments, you need to log in
Error 419 after migrating a Laravel site to hosting. How to fix?
After transferring the application to Laravel v.8 from the local OpenServer to the server, a problem appeared - error 419. The work of all forms - including authorization and authentication.
An error message 419 is issued.
As I understand it, the problem is with CSRF - protection . But the problem arose only after the transfer of the site to the server, everything worked on LAN. And of course the @csrf directives are present in the forms, and the IMPUT tag with the token in the form is formed:
<input type="hidden" name="_token" value="RIhn7KmFAjyVxFwX6STjCDHtXSEPRbAqJaX88x3D">
'domain' => env('SESSION_DOMAIN', null),
'secure' => env('SESSION_SECURE_COOKIE', false),
Answer the question
In order to leave comments, you need to log in
Problem solved. In my case, the problem was in the server configuration. The site is hosted on a VDS server with a BrainyCP control panel. The panel was configured for the work of sites on Bitrix, including the necessary parameter for the work of Bitrix - BrainyCP mbstring.func_overload .
According to the server logs, when trying to save any data through a form on the site, a 419 error was processed.
In the server logs, there is a record of this error in the form:
[Fri Nov 13 12:35:33.249913 2020] [proxy_fcgi:error] [pid 18854:tid 140666176743168] [client 212.45.19.58:43938] AH01071: Got error 'PHP message: PHP Deprecated: The mbstring.func_overload directive is deprecated in Unknown on line 0', referer: http://hight-control.ru/
Just last week I had to face the same after moving from one hosting to another. See where you have configured folding sessions, check if there is access there. For example, I had so that the sessions were added to the memcache, but the memcache itself was forgotten to be launched on the hosting.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question