I'm working on an order form where the items to be ordered are set in a cookie. When the form is submitted, it is processed and it goes to a confirmation page with details of the order.
At the end of the confirmation page, the cookie is removed with jQuery $.removeCookie("cookie_name");
and the session is destroyed in PHP session_unset(); session_destroy();
If the user clicks the back button, the top of the order page looks to see if that cookie is present and if not, it skips the page and goes back to the starting point before any items were chosen.
if (!isset($_COOKIE["cookie_name"])) {
header( 'Location: order.php' );
exit;
}
Oh Chrome, this works just fine. On Safari, pressing the back button from the confirmation page stays on the page and shows all the items as if they were not ordered yet. However the cookie was destroyed. It is just displaying the page. How can I get Safari to realize that the cookie is actually gone? Refreshing the page clears it out and redirects as it should. I tried setting the a cache busting variable on the javascript file and tried setting the meta tag to not cache the whole page but it appears to be related to Safari.
Thanks!