1. Description of the problem
Upload the Laravel project to the server, the local database export and import to the server database, everything works fine, but when the user logon times wrong
Decryptexception in compiled.php line 13238:the MAC is invalid
Or
decryptexception in baseencrypter.php line 48:the MAC is invalid
2. Resolution process
Internet query found many people say is laravel key problem, to regenerate, clear the cache. But I tried to find out that the error
Decryptexception in compiled.php line 13238:the MAC is invalid
Become a
Decryptexception in baseencrypter.php line 48:the MAC is invalid
The problem is still unresolved.
settings:
before using Laravel encryption, you need to first config/ The key parameter in the app.php configuration file sets a value that is a string that contains 32 random characters. If this value is not set correctly, all data encrypted by Laravel is not secure.
basic usage:
encryption
3. Summary
to report the wrong Mac value is not the computer MAC address, but Laravel's encrypt encryption is related to its app_key, and each data is given a special Mac verification code.
after changing the environment, you need to regenerate key first, and then encrypt the data in the database using encrypt encryption.
This shows that once the App_key changes, the database of a large number of encrypt encrypted data will be all obsolete, which is not conducive to database migration and backup, so use hash encryption.
Laravel Project Error decryptexception:the MAC is invalid.