tunnelboy Posted November 8, 2020 Share Posted November 8, 2020 Built an ecommerce site from scratch 10+ years ago. Haven't changed anything significant. Now all of the sudden, some users are reporting lost sessions (empty carts, or empty carts upon return from a PayPal transaction, etc). I've put in a simple check that writes the results to a log page, and there is no understanding what is wrong. # Example page 1 session_start(); $_session['foo'] = "test"; # Go to page 2 #Example page 2 session_start(); if ($_session['foo'] != "test") exit("Session Lost!"); Often it works, sometimes it doesn't. Of course the script is more involved, but the check for a lost session is RIGHT AFTER session_start(); And I have it set to a log file, so I can see if and when it happens. Odd thing is that it's working most of the time. I get orders. But some people have said their cart is emptying. My host said everything is working fine on their end. Any ideas? Where to start? How to troubleshoot further? Should I just append a custom $sid to every URL with like a hidden form entry? Very frustrating. Quote Link to comment https://forums.phpfreaks.com/topic/311689-session-headaches/ Share on other sites More sharing options...
requinix Posted November 9, 2020 Share Posted November 9, 2020 10 years of code doesn't stop working overnight. Something changed. Find out what and you might get your answer. Maybe it's a PHP version? Did someone apply software updates? Changed server hardware? Quote Link to comment https://forums.phpfreaks.com/topic/311689-session-headaches/#findComment-1582279 Share on other sites More sharing options...
tunnelboy Posted November 10, 2020 Author Share Posted November 10, 2020 I agree with you 100% I have been using Stablehost for a very long time and it *was* great. Then they sourced their support overseas and it's been horrible ever since. Whatever the issue, it's NEVER their fault. Never ever. I had my MySQL locked up like a week ago, and I was actually pleading with them to restart the server and they insisted everything was fine. He finally agreed to restart it and all was fine seconds after restarting it. I have already gone with another host. I'm dreading the move, but just wanted to make sure there wasn't an issue that I was doing. Thank! Quote Link to comment https://forums.phpfreaks.com/topic/311689-session-headaches/#findComment-1582298 Share on other sites More sharing options...
gizmola Posted November 10, 2020 Share Posted November 10, 2020 You also have to realize that there are no longer any versions of PHP that will work with unaltered 10 year old code. You most likely will need to update your system to work with a current supported version of PHP. Quote Link to comment https://forums.phpfreaks.com/topic/311689-session-headaches/#findComment-1582303 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.