Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

basosneo's avatar

Keep the session active

I am developing a project in laravel about an online store and I have noticed that when I log in a user and go to the shopping cart, I close or the session is disabled .. someone can help me so that none Of my sessions disappears or is closed by magic? Thanks

0 likes
5 replies
jlrdw's avatar

Are the permissions correct? And probably a dumb question but is the shopping cart on the same domain? Do you have web Middleware setup correctly? Oh in another post someone mentioned that this worked

Session::save();
basosneo's avatar

i dont understand your question about the some domain ... i start the project whit laravel server and al of my work are in extesion about the same local host i think.

and where i see my middleware setup? and how is the correct form?

where i writte this comand? Session::save();

thanks

jlrdw's avatar

Have you even tried Session::save();

basosneo's avatar

these command dont work men, i discover that the session ends when i go to te cartshopping.. i tried writting these command on the cartcontroller but dont work... another idea?

Please or to participate in this conversation.