I have created a web application in Laravel. I am using an authentication plugin to authorize the users while logging-in on my web application. On my local system, everything was working fine.
But when I uploaded my Laravel project from the local server to the test server, I faced one problem. When the user was trying to log in by entering their correct credentials, he was always redirected to the login page. Because the Auth session was not persisting on the welcome page. When I printed out the Auth::user() value, it was always showing an empty array
Finally, to solve this problem I have run the below commands on the test server:
php artisan cache:clear
php artisan config:cache
php artisan view:clear
php artisan route:clear
php artisan route:cache
And got the results as “User logged-in successfully!”.