This Error comes When i try to server site login.
How to solve this error?
You have to set a news Key, use the following command:
php artisan key:generate
After that test again to run the Laravel Application
php artisan serve
See the similiar question: unserialize(): Error at offset 0 of 40 bytes Error
Laravel made a change to the way it handles cookies from V5.6.30 to improve security. It may be that you are trying to decrypt something that isn't serialized or vice versa.
First, Delete the cookies in your browser and/or clear your session-files in your Laravel app.
Or, within the middleware app\Http\Middleware\EncryptCookies.php
, you can flip it to test:
add: protected static $serialize = true;
This is a pretty common question - you can search stack overflow for similar answers if this doesn't work.
Delete the cookies in your browser and/or clear your session-files in your Laravel app.
I got the same error, when I upgrade a Laravel 5.5 app to 5.6. The error comes form the EncryptCookies-Middleware.
This type of issue normally rise when you downgrade your Laravel version and a quick solution is I just clear my laravel and browser cache and it will work fine for me. Browser cache clear is mostly important.