Search code examples
laravelsessioncpanel

Laravel 8 session not persist when redirect to the home (root) page


I'm working on Laravel website, on the local environment the site works well, the issue appeared after deployment on cpanel, the process works as follows, after login successfully the user is redirected to profile page, the problem is seen when redirecting to the (root) home page, the session is not persist,

i've changed the session_drive from 'file' to 'database' however the problem not solved, also added the web middleware to web routes but not solved the problem


Solution

  • After review, it turns out that the issue because i didn't add a guest middleware on the login route in the web.php file