I've recently migrated a bunch of websites to a new VPS and I've been having a lot of trouble with PHP sessions. All the websites are pretty much configured the same way, but there is one website where the sessions don't always work. The thing that bugs me is it's kind of random. I can go on the website, log in, and the session will work fine. Then, I go back a hour later, try to log in on the same account, but it doesn't keep my session anymore.
The VPS is running on CentOS 5.8 and it has PHP 5.4.3. I should mention that before the migration, the website was running on PHP 5.3.
I have checked the session.save.path and it is fine. I can even see the session files (with the correct user and everything) but they are empty when the sessions are not working, which makes sense. But why does it sometimes work, and sometimes it doesn't? I'm having trouble figuring this one out.