Laravel Project Login Error: The MAC is invalid.

Source: Internet
Author: User

After the Laravel project finishes deploying to the server, the database import succeeds

Background Login Error:

Google a bit, found a lot of the same problem, looked at, there is a very interesting:

I need a smiley face to describe my mood now, clear artisan cache, clear composer cache, dump AutoLoad, empty browser Cahe--still nothing. It was still nothing to make such a big list.

OK, the first time to hold a very happy mood to adjust the Bug.

Keep looking, look for ... Hey, I found it.

It turns out that Laravel's App_key (. env file) and the Encrypt () function encrypt the problem.

Once the PHP artisan key: Generate regenerated App_key, the Desrypt () function decrypts the MAC is invalid exception, this is due to the App_key change causes the computer MAC information has changed and decrypt () decryption has reported an exception.

Workaround:

Method 1, re-use Encrypt () to encrypt, background re-login, OK.

Method 2, indeed, feel that this encryption method is not conducive to project migration and deployment, to adopt this blog post recommendations, temporarily using hash encryption.

Laravel Project Login Error: The MAC is invalid.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.