I’m developing a web application using the Laravel framework. I’m using the Laravel session system in a section of my application and have configured it to store sessions in the database.
My problem is that the session set in one of the routes of the application is not displayed correctly in other pages and instead, the value null is returned. I should mention that this problem only occurs when I send a request to the server via AJAX and update the session.
I’ve checked all the session configuration settings as well as the php.ini and .env settings, but the problem still persists. Do you have any ideas for solving this problem?
https://gist.github.com/realrezamirzaei/3fd51d57a95f90bacd3cc4aec06ba923
“I tried configuring the Laravel session to store sessions in the database, and I have checked the session settings in the php.ini and .env files. However, the session set in one of the routes of my application is not displayed correctly in other pages, and instead, the value null is returned. I was expecting the session to be displayed correctly on all pages.”