marmite Posted May 17, 2007 Share Posted May 17, 2007 This is a really odd one. I have one page, bulkview.php, which shows various products with a GET param, e.g. http://www.cardsunlimited.com/bulkview.php?id=pink_rose This bulkview page processes information differently depending whether the previous page (stored in $_SESSION['prevpage']) was greetingscards.php, retailgreetingcards.php, or partyinvitations.php. So, e.g. it only shows cellophane-wrapped cards to users who've come via retailgreetingcards. But the page won't add to cart for those who've come via retailgreetingcards !! It works on Test. It works for all other routes. It was working yesterday, or the day before. The problem seems to be that all SESSION variables are unsetting themselves when users click Add to Cart but why? why?? I don't know where to start on this one. Can anyone help? Emma Quote Link to comment https://forums.phpfreaks.com/topic/51811-problem-in-production-urgent-session-variables-disappearing/ Share on other sites More sharing options...
hitman6003 Posted May 17, 2007 Share Posted May 17, 2007 do all pages have "session_start()" at the top? Quote Link to comment https://forums.phpfreaks.com/topic/51811-problem-in-production-urgent-session-variables-disappearing/#findComment-255296 Share on other sites More sharing options...
marmite Posted May 17, 2007 Author Share Posted May 17, 2007 Yep. I've done a few print_rs and narrowed down the problem. My SESSION['prevpage'] and SESSION['currpage'], which determine all the cart functions, are resetting from retailgreetingcards.php and bulkview.php respectively, to bulkview.php and notfound.php respectively (i.e. 404 error). This is happeniing BEFORE the code below is called... it's like some sort of weird refresh error, just for users who've come via a certain page... baffled if (!isset($_GET['deleteid'])) { if ($_SESSION['currpage']) { $_SESSION['prevpage']=$_SESSION['currpage']; $_SESSION['prevquery']=$_SESSION['currquery']; } $_SESSION['currpage']=$_SERVER['PHP_SELF']; $_SESSION['currquery']=$_SERVER['QUERY_STRING']; } Quote Link to comment https://forums.phpfreaks.com/topic/51811-problem-in-production-urgent-session-variables-disappearing/#findComment-255298 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.