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

royh's avatar
Level 1

Sessions being overridden

Hello. I have developed a Laravel 4 application a few years ago which hasn't broken since. All of a sudden users were seeing others users information. Basically what happens is I use Auth::attempt to check the user and, if valid, I use Auth::user() to get the user. What is happening is there is only one session being written to the storage/sessions folder and whenever a new user logs in, this session is overridden with the new values. Hence, it will show the last persons data. I have used EXACTLY the same solution on another server and it makes a new session whenever someone tries to login.

My question is why is it only creating one session? How can I fix this please?

It is on a shared hosting platform and I am assuming that with a PHP update or something, something has broken. As mentioned it worked for years and now has stopped which means that it probably is a configuration. Please can you help me?

0 likes
6 replies
jlrdw's avatar

Go to that cpanel and make sure they didn't update to a php ver higher than 4.2 supports, usually you can select a version. Also make sure the required extensions are still enabled.

There is an update to 4.2 which makes it work with php 7.

royh's avatar
Level 1

Hi. The PHP Version 5.6.26 so it isn't even PHP 7 yet. Can you perhaps tell me which modules I should make sure that need to be installed?

royh's avatar
Level 1

All of these have been enabled and fulfilled on the server.

jlrdw's avatar

And you have made no changes at all anywhere? Something on the host had to change, contact tech support and see if the way sessions are handled on shared hosting has changed.

royh's avatar
Level 1

No changes have been made at all from my side. Thank you @jlrdw - I will ask them

Please or to participate in this conversation.