add the following code to the checkout success page after the closing </html> tag:
<?php
// Initialize the session.
// If you are using session_name("something"), don't forget it now!
@session_start();
// 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 (ini_get("session.use_cookies")) {
$params = session_get_cookie_params();
@setcookie(session_name(), '', time() - 42000,
$params["path"], $params["domain"],
$params["secure"], $params["httponly"]
);
}
// Finally, destroy the session.
@session_destroy();
@session_regenerate_id();
?>
this will destroy the session when a transaction is successful.
On the confirm page, double check the eCart Store Order Summary behavior, make sure that no value is being assigned to the Primary Key OrderID column in the bindings section.
In the Order ID section make sure the Primary Key OrderID column is selected, and note the name used in the store as section. This is the name of the session that is stores the order ID
now double check the eCart Store Order Details behavior. The Order ID should be set to the relational DetailOrderID column. In the bindings section, make sure that the DetailOrderID is bound to the session created by the store order summary behavior.