session
Where do I add this code?
PHP Code:
session_regenerate_id();
To test to see if your session is being cleared out properly just after the session destroy code that you have put in this code:
PHP Code:
var_dump($_SESSION);
This line of code should print out the contents of the session object and let you know exactly what is in the session at the end of this checkout success page.
I already have that line:
<?php
// Initialize the session.
// If you are using session_name("something"), don't forget it now!
@session_start();
echo("Before destrying the session: ");
var_dump($_SESSION);
echo("<br />");
// Unset all of the session variables.
$_SESSION = array();
// If it's desired to kill the session, also delete the session cookie.
// Note: This will destroy the session, and not just the session data!
if (isset($_COOKIE[session_name()])) {
@setcookie(session_name(), '', time()-42000, '/');
}
// Finally, destroy the session.
session_destroy();
echo("After destrying the session: ");
var_dump($_SESSION);
?>
I don't get to see the success page because it stops at the paypal page saying that the order has already been placed.