Jump to content

Problem in Production - urgent! SESSION variables disappearing


marmite

Recommended Posts

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

 

Link to comment
Share on other sites

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'];
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.