This is an ecommerce application, users choose their items, go through a basket page (which calculates postage, tax etc), then checkout. A session variable (checkoutStage) is used to keep track of their access to the checkout, this is set in the basket. They must visit the basket before the checkout and if they navigate away, to any other page the variable is reset. This is to allow them to change their order and have basket calculations performed again. If the checkoutStage variable is 0 when they try to access checkout they are redirected to the basket, which sets it to 1. ie to turn checkout-> other page -> checkout into checkout-> other page -> basket -> checkout.
Chrome will not let anyone beyond the basket and keeps redirecting users back i.e basket->basket->basket... Echoing the session before the redirect shows checkoutStage to be 0, at the end of the basket an echo shows 1. The basket links directly to checkout and other browsers work with it ok.
In the basket there is the line
Code: Select all
$_SESSION['checkoutStage'] = 1;Code: Select all
if($_SESSION['checkoutStage'] == 0) {
//redirect
}
Code: Select all
//this is the quick workaround
$browser_is_chrome = false;
if(eregi("chrome", $_SERVER['HTTP_USER_AGENT'])) {
$browser_is_chrome = true;
}
//force user through basket for updated calculation of totals if they navigate away from checkout
if($browser_is_chrome == false && strcmp($m,'checkout') != 0) {
$_SESSION['checkoutStage'] = 0;
}